提交 7c20f3f9 编写于 作者: M Mr.doob

Merge remote-tracking branch 'jsermeno/dev' into dev

......@@ -130,6 +130,7 @@ THREE.Object3D.prototype = {
},
remove: function ( object ) {
var scene = this;
var childIndex = this.children.indexOf( object );
......@@ -138,6 +139,20 @@ THREE.Object3D.prototype = {
object.parent = undefined;
this.children.splice( childIndex, 1 );
// remove from scene
while ( scene.parent !== undefined ) {
scene = scene.parent;
}
if ( scene !== undefined && scene instanceof THREE.Scene ) {
scene.removeChildRecurse( object );
}
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册