|
@@ -2,21 +2,19 @@ import { LightShadow } from './LightShadow.js';
|
|
|
import { MathUtils } from '../math/MathUtils.js';
|
|
|
import { PerspectiveCamera } from '../cameras/PerspectiveCamera.js';
|
|
|
|
|
|
-function SpotLightShadow() {
|
|
|
+class SpotLightShadow extends LightShadow {
|
|
|
|
|
|
- LightShadow.call( this, new PerspectiveCamera( 50, 1, 0.5, 500 ) );
|
|
|
+ constructor() {
|
|
|
|
|
|
- this.focus = 1;
|
|
|
+ super( new PerspectiveCamera( 50, 1, 0.5, 500 ) );
|
|
|
|
|
|
-}
|
|
|
-
|
|
|
-SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), {
|
|
|
+ Object.defineProperty( this, 'isSpotLightShadow', { value: true } );
|
|
|
|
|
|
- constructor: SpotLightShadow,
|
|
|
+ this.focus = 1;
|
|
|
|
|
|
- isSpotLightShadow: true,
|
|
|
+ }
|
|
|
|
|
|
- updateMatrices: function ( light ) {
|
|
|
+ updateMatrices( light ) {
|
|
|
|
|
|
const camera = this.camera;
|
|
|
|
|
@@ -33,11 +31,10 @@ SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
|
|
|
|
|
|
}
|
|
|
|
|
|
- LightShadow.prototype.updateMatrices.call( this, light );
|
|
|
+ super.updateMatrices( light );
|
|
|
|
|
|
}
|
|
|
|
|
|
-} );
|
|
|
-
|
|
|
+}
|
|
|
|
|
|
export { SpotLightShadow };
|