Pārlūkot izejas kodu

DirectionalLightShadow: Convert to ES6 class

Mr.doob 4 gadi atpakaļ
vecāks
revīzija
bb5cfdefa5
1 mainītis faili ar 5 papildinājumiem un 14 dzēšanām
  1. 5 14
      src/lights/DirectionalLightShadow.js

+ 5 - 14
src/lights/DirectionalLightShadow.js

@@ -1,25 +1,16 @@
 import { LightShadow } from './LightShadow.js';
 import { LightShadow } from './LightShadow.js';
 import { OrthographicCamera } from '../cameras/OrthographicCamera.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 };
 export { DirectionalLightShadow };