Ver Fonte

Added .focus property

WestLangley há 4 anos atrás
pai
commit
250bf0aa2e
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      src/lights/SpotLightShadow.js

+ 3 - 1
src/lights/SpotLightShadow.js

@@ -6,6 +6,8 @@ function SpotLightShadow() {
 
 	LightShadow.call( this, new PerspectiveCamera( 50, 1, 0.5, 500 ) );
 
+	this.focus = 1;
+
 }
 
 SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), {
@@ -18,7 +20,7 @@ SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
 
 		const camera = this.camera;
 
-		const fov = MathUtils.RAD2DEG * 2 * light.angle;
+		const fov = MathUtils.RAD2DEG * 2 * light.angle * this.focus;
 		const aspect = this.mapSize.width / this.mapSize.height;
 		const far = light.distance || camera.far;