Skip to content

Commit 74a9e24

Browse files
committed
Modified shadow maps to use world positions of SpotLight and its target.
This should allow to have spotlights as a parts of hierarchy.
1 parent 62ddbb2 commit 74a9e24

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

build/custom/ThreeExtras.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/ThreeWebGL.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extras/plugins/ShadowMapPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ THREE.ShadowMapPlugin = function ( ) {
9090
shadowMatrix = light.shadowMatrix;
9191
shadowCamera = light.shadowCamera;
9292

93-
shadowCamera.position.copy( light.position );
94-
shadowCamera.lookAt( light.target.position );
93+
shadowCamera.position.copy( light.matrixWorld.getPosition() );
94+
shadowCamera.lookAt( light.target.matrixWorld.getPosition() );
9595

9696
shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld );
9797

0 commit comments

Comments
 (0)