浏览代码

GLTFLoader: Reset spotlight default position.

Don McCurdy 6 年之前
父节点
当前提交
4a44e2581f
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      examples/js/loaders/GLTFLoader.js

+ 4 - 0
examples/js/loaders/GLTFLoader.js

@@ -365,6 +365,10 @@ THREE.GLTFLoader = ( function () {
 
 
 		}
 		}
 
 
+		// Some lights (e.g. spot) default to a position other than the origin. Reset the position
+		// here, because node-level parsing will only override position if explicitly specified.
+		lightNode.position.set( 0, 0, 0 );
+
 		lightNode.decay = 2;
 		lightNode.decay = 2;
 
 
 		if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;
 		if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;