浏览代码

change child reference to object reference

Justin Sermeno 14 年之前
父节点
当前提交
2f234a2ac8
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/core/Object3D.js

+ 3 - 3
src/core/Object3D.js

@@ -132,11 +132,11 @@ THREE.Object3D.prototype = {
 	remove: function ( object ) {
 	remove: function ( object ) {
 		var scene = this;
 		var scene = this;
 
 
-		var childIndex = this.children.indexOf( child );
+		var childIndex = this.children.indexOf( object );
 
 
 		if ( childIndex !== - 1 ) {
 		if ( childIndex !== - 1 ) {
 
 
-			child.parent = undefined;
+			object.parent = undefined;
 			this.children.splice( childIndex, 1 );
 			this.children.splice( childIndex, 1 );
 
 
 			// remove from scene
 			// remove from scene
@@ -149,7 +149,7 @@ THREE.Object3D.prototype = {
 
 
 			if ( scene !== undefined && scene instanceof THREE.Scene ) {
 			if ( scene !== undefined && scene instanceof THREE.Scene ) {
 
 
-				scene.removeChildRecurse( child );
+				scene.removeChildRecurse( object );
 
 
 			}
 			}