Skip to content

Commit 31545b9

Browse files
committed
SpotLightShadow: Convert to ES6 class
1 parent b9dd2b6 commit 31545b9

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/lights/SpotLightShadow.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ import { LightShadow } from './LightShadow.js';
22
import { MathUtils } from '../math/MathUtils.js';
33
import { PerspectiveCamera } from '../cameras/PerspectiveCamera.js';
44

5-
function SpotLightShadow() {
5+
class SpotLightShadow extends LightShadow {
66

7-
LightShadow.call( this, new PerspectiveCamera( 50, 1, 0.5, 500 ) );
7+
constructor() {
88

9-
this.focus = 1;
9+
super( new PerspectiveCamera( 50, 1, 0.5, 500 ) );
1010

11-
}
12-
13-
SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), {
11+
Object.defineProperty( this, 'isSpotLightShadow', { value: true } );
1412

15-
constructor: SpotLightShadow,
13+
this.focus = 1;
1614

17-
isSpotLightShadow: true,
15+
}
1816

19-
updateMatrices: function ( light ) {
17+
updateMatrices( light ) {
2018

2119
const camera = this.camera;
2220

@@ -33,11 +31,10 @@ SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
3331

3432
}
3533

36-
LightShadow.prototype.updateMatrices.call( this, light );
34+
super.updateMatrices( light );
3735

3836
}
3937

40-
} );
41-
38+
}
4239

4340
export { SpotLightShadow };

0 commit comments

Comments
 (0)