瀏覽代碼

Merge remote-tracking branch 'remotes/AddictArts/dev_lightTargets' into unflip

alteredq 13 年之前
父節點
當前提交
d7dcc6cdd5
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 0 1
      examples/webgl_materials_cubemap_dynamic.html
  2. 6 0
      src/scenes/Scene.js

+ 0 - 1
examples/webgl_materials_cubemap_dynamic.html

@@ -179,7 +179,6 @@
 				spotLight.shadowMapHeight = SHADOW_MAP_HEIGHT;
 
 				scene.add( spotLight );
-				scene.add( spotLight.target );
 
 				directionalLight2 = new THREE.PointLight( 0xff9900, 0.25 );
 				directionalLight2.position.set( 0.5, -1, 0.5 );

+ 6 - 0
src/scenes/Scene.js

@@ -31,6 +31,12 @@ THREE.Scene.prototype.__addObject = function ( object ) {
 
 		}
 
+		if ( object.target && object.target.parent === undefined ) {
+
+			this.add( object.target );
+
+		}
+
 	} else if ( !( object instanceof THREE.Camera || object instanceof THREE.Bone ) ) {
 
 		if ( this.__objects.indexOf( object ) === - 1 ) {