|
@@ -2,26 +2,24 @@ import { Light } from './Light.js';
|
|
|
import { Color } from '../math/Color.js';
|
|
|
import { Object3D } from '../core/Object3D.js';
|
|
|
|
|
|
-function HemisphereLight( skyColor, groundColor, intensity ) {
|
|
|
+class HemisphereLight extends Light {
|
|
|
|
|
|
- Light.call( this, skyColor, intensity );
|
|
|
+ constructor( skyColor, groundColor, intensity ) {
|
|
|
|
|
|
- this.type = 'HemisphereLight';
|
|
|
+ super( skyColor, intensity );
|
|
|
|
|
|
- this.position.copy( Object3D.DefaultUp );
|
|
|
- this.updateMatrix();
|
|
|
+ Object.defineProperty( this, 'isHemisphereLight', { value: true } );
|
|
|
|
|
|
- this.groundColor = new Color( groundColor );
|
|
|
+ this.type = 'HemisphereLight';
|
|
|
|
|
|
-}
|
|
|
-
|
|
|
-HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), {
|
|
|
+ this.position.copy( Object3D.DefaultUp );
|
|
|
+ this.updateMatrix();
|
|
|
|
|
|
- constructor: HemisphereLight,
|
|
|
+ this.groundColor = new Color( groundColor );
|
|
|
|
|
|
- isHemisphereLight: true,
|
|
|
+ }
|
|
|
|
|
|
- copy: function ( source ) {
|
|
|
+ copy( source ) {
|
|
|
|
|
|
Light.prototype.copy.call( this, source );
|
|
|
|
|
@@ -31,7 +29,6 @@ HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
-} );
|
|
|
-
|
|
|
+}
|
|
|
|
|
|
export { HemisphereLight };
|