diff --git a/src/Viewer.js b/src/Viewer.js index 79a1f462..a8b04e61 100644 --- a/src/Viewer.js +++ b/src/Viewer.js @@ -209,6 +209,8 @@ export class Viewer { const maxPrecision = this.integerBasedSort ? 20 : 24; this.splatSortDistanceMapPrecision = clamp(this.splatSortDistanceMapPrecision, 10, maxPrecision); + this.isUpdatedForDropInMode = false; + this.onSplatMeshChangedCallback = null; this.createSplatMesh(); @@ -1623,7 +1625,7 @@ export class Viewer { }(); update(renderer, camera) { - if (this.dropInMode) this.updateForDropInMode(renderer, camera); + if (this.dropInMode && !this.isUpdatedForDropInMode) this.updateForDropInMode(renderer, camera); if (!this.initialized || !this.splatRenderReady || this.isDisposingOrDisposed()) return; @@ -1649,6 +1651,7 @@ export class Viewer { this.camera = camera; if (this.controls) this.controls.object = camera; this.init(); + this.isUpdatedForDropInMode = true; } updateFPS = function() { diff --git a/src/splatmesh/SplatMesh.js b/src/splatmesh/SplatMesh.js index 1170f7d4..99a8e9ef 100644 --- a/src/splatmesh/SplatMesh.js +++ b/src/splatmesh/SplatMesh.js @@ -233,7 +233,7 @@ export class SplatMesh extends THREE.Mesh { this.disposeSplatTree(); // TODO: expose SplatTree constructor parameters (maximumDepth and maxCentersPerNode) so that they can // be configured on a per-scene basis - this.baseSplatTree = new SplatTree(8, 1000); + this.baseSplatTree = new SplatTree(12, 1000); const buildStartTime = performance.now(); const splatColor = new THREE.Vector4(); this.baseSplatTree.processSplatMesh(this, (splatIndex) => {