提交 c49dcddc 编写于 作者: B Ben Adams

Copy BufferGeo to self or InstancedGeo

上级 526c06d9
......@@ -1209,6 +1209,33 @@ THREE.BufferGeometry.prototype = {
return geometry;
},
copy: function ( geometry ) {
for ( var attr in geometry.attributes ) {
var sourceAttr = geometry.attributes[attr];
this.addAttribute( attr, sourceAttr.clone() );
}
for ( var i = 0, il = geometry.offsets.length; i < il; i++ ) {
var offset = geometry.offsets[i];
this.offsets.push( {
start: offset.start,
index: offset.index,
count: offset.count
} );
}
return this;
},
dispose: function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册