aframe-gaussian-splatting
aframe-gaussian-splatting copied to clipboard
Clear out current splat before loading new splat
If I dynamically change the src value of an a-entity, I can get it to load new geometry. I added a setSource() method for this.
But I can't seem to see how to clear out the old geometry...?
/*
//where source is:
{
"a": {
position: [0,0,0],
rotation: [0,90,0],
scale: [1,1,1],
src: "some/url/to/file.splat"
},
"b": {
position: [0,0,10],
rotation: [0,0,90],
scale: [2,2,2],
src: "some/url/to/other.splat"
},
}
*/
setSource: function(source) {
this.el.object3D.position.set(...source.position);
this.el.object3D.rotation.set(...source.rotation);
this.el.object3D.scale.set( ...source.scale);
this.clearData();
this.loadData(this.camera, this.object, this.renderer, source.src);
},
clearData: function() {
//...?
},