fix mesh gl errors with geometry shallow clone

This commit is contained in:
Stewart Allen 2022-01-04 17:42:19 -05:00
commit 19721b0dcc
3 changed files with 14 additions and 18 deletions

View file

@ -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);