提交 92f406bb 编写于 作者: I Ivo Benner

fixed: in-frame adding and removing same objects from scene leads to missing objects

上级 10e42ba8
......@@ -50,6 +50,16 @@ THREE.Scene.prototype.addChildRecurse = function ( child ) {
this.objects.push( child );
this.__objectsAdded.push( child );
// check if previously removed
var i = this.__objectsRemoved.indexOf( child );
if ( i !== -1 ) {
this.__objectsRemoved.splice( i, 1 );
}
}
......@@ -91,6 +101,15 @@ THREE.Scene.prototype.removeChildRecurse = function ( child ) {
this.objects.splice( i, 1 );
this.__objectsRemoved.push( child );
// check if previously added
var ai = this.__objectsAdded.indexOf( child );
if ( ai !== -1 ) {
this.__objectsAdded.splice( ai, 1 );
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册