Skip to content

Commit 7b518ca

Browse files
committed
HemisphereLight: Convert to ES6 class
1 parent 32172e1 commit 7b518ca

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/lights/HemisphereLight.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@ import { Light } from './Light.js';
22
import { Color } from '../math/Color.js';
33
import { Object3D } from '../core/Object3D.js';
44

5-
function HemisphereLight( skyColor, groundColor, intensity ) {
5+
class HemisphereLight extends Light {
66

7-
Light.call( this, skyColor, intensity );
7+
constructor( skyColor, groundColor, intensity ) {
88

9-
this.type = 'HemisphereLight';
9+
super( skyColor, intensity );
1010

11-
this.position.copy( Object3D.DefaultUp );
12-
this.updateMatrix();
11+
Object.defineProperty( this, 'isHemisphereLight', { value: true } );
1312

14-
this.groundColor = new Color( groundColor );
13+
this.type = 'HemisphereLight';
1514

16-
}
17-
18-
HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), {
15+
this.position.copy( Object3D.DefaultUp );
16+
this.updateMatrix();
1917

20-
constructor: HemisphereLight,
18+
this.groundColor = new Color( groundColor );
2119

22-
isHemisphereLight: true,
20+
}
2321

24-
copy: function ( source ) {
22+
copy( source ) {
2523

2624
Light.prototype.copy.call( this, source );
2725

@@ -31,7 +29,6 @@ HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), {
3129

3230
}
3331

34-
} );
35-
32+
}
3633

3734
export { HemisphereLight };

0 commit comments

Comments
 (0)