ソースを参照

DirectionalLightShadow: Convert to ES6 class

Mr.doob 4 年 前
コミット
bb5cfdefa5
1 ファイル変更5 行追加14 行削除
  1. 5 14
      src/lights/DirectionalLightShadow.js

+ 5 - 14
src/lights/DirectionalLightShadow.js

@@ -1,25 +1,16 @@
 import { LightShadow } from './LightShadow.js';
 import { OrthographicCamera } from '../cameras/OrthographicCamera.js';
 
-function DirectionalLightShadow() {
+class DirectionalLightShadow extends LightShadow {
 
-	LightShadow.call( this, new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );
+	constructor() {
 
-}
-
-DirectionalLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), {
-
-	constructor: DirectionalLightShadow,
-
-	isDirectionalLightShadow: true,
+		super( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );
 
-	updateMatrices: function ( light ) {
-
-		LightShadow.prototype.updateMatrices.call( this, light );
+		Object.defineProperty( this, 'isDirectionalLightShadow', { value: true } );
 
 	}
 
-} );
-
+}
 
 export { DirectionalLightShadow };