Added world reduction after subtree removel from the scene. Removed all sandbox calls to the World interface

This commit is contained in:
AlexandruPopovici
2023-05-06 00:07:06 +03:00
parent 793f8bab51
commit a8a43497d2
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -126,16 +126,16 @@ export default class Sandbox {
this.refresh()
})
viewer.on(ViewerEvent.UnloadComplete, (url: string) => {
url
this.removeViewControls()
this.addViewControls()
this.properties = this.viewer.getObjectProperties()
viewer.World.reduceWorld(this.viewer.getWorldTree().getRenderTree(url).treeBounds)
})
viewer.on(ViewerEvent.UnloadAllComplete, (url: string) => {
this.removeViewControls()
this.addViewControls()
this.properties = this.viewer.getObjectProperties()
viewer.World.resetWorld()
// viewer.World.resetWorld()
url
})
viewer.on(ViewerEvent.ObjectClicked, (selectionEvent: SelectionEvent) => {
@@ -600,6 +600,11 @@ export default class SpeckleRenderer {
this.rootGroup.remove(this.rootGroup.getObjectByName(subtreeId))
this.updateShadowCatcher()
const batches = this.batcher.getBatches(subtreeId)
batches.forEach((value) => {
this.viewer.World.reduceWorld(value.bounds)
})
this.batcher.purgeBatches(subtreeId)
this.updateDirectLights()
this.updateHelpers()