[英]Proper way to getDescendants() on THREE.js as of r68
这是从r.68中删除的getDescendants()
方法:
THREE.Object3D.prototype.getDescendants = function ( array ) {
if ( array === undefined ) array = [];
Array.prototype.push.apply( array, this.children );
for ( var i = 0, l = this.children.length; i < l; i ++ ) {
this.children[ i ].getDescendants( array );
}
return array;
};
如果要编写自定义内容,可以使用Object3D.traverse()
方法。
object.traverse( function( node ) {
// your code here
} );
three.js r.68
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.