fix mesh gl errors with geometry shallow clone
This commit is contained in:
parent
027f75ef6d
commit
19721b0dcc
3 changed files with 14 additions and 18 deletions
|
|
@ -111,6 +111,14 @@
|
|||
return this;
|
||||
};
|
||||
|
||||
BP.shallowClone = function() {
|
||||
let geo = new THREE.BufferGeometry();
|
||||
for (let [k, v] of Object.entries(this.attributes)) {
|
||||
geo.setAttribute(k, new THREE.BufferAttribute(v.array, v.itemSize));
|
||||
}
|
||||
return geo;
|
||||
};
|
||||
|
||||
THREE.Object3D.prototype.newGroup = function() {
|
||||
var group = new THREE.Group();
|
||||
this.add(group);
|
||||
|
|
|
|||
Loading…
Reference in a new issue