@@ -2,26 +2,24 @@ import { Light } from './Light.js';
22import { Color } from '../math/Color.js' ;
33import { 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
3734export { HemisphereLight } ;
0 commit comments