Skip to content

Commit

Permalink
Optimize xeokit PerformanceModel#destroy()
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Nov 4, 2019
1 parent b6d8c73 commit d70cfb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ class PerformanceNode {
if (this._isObject) {
scene._deregisterObject(this);
if (this.visible) {
scene._objectVisibilityUpdated(this);
scene._objectVisibilityUpdated(this, false);
}
if (this.xrayed) {
scene._objectXRayedUpdated(this);
Expand Down
6 changes: 4 additions & 2 deletions lib/xeokit/viewer/scene/scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,14 +905,16 @@ class Scene extends Component {
this._objectIds = null; // Lazy regenerate
}

_objectVisibilityUpdated(entity) {
_objectVisibilityUpdated(entity, notify=true) {
if (entity.visible) {
this.visibleObjects[entity.id] = entity;
} else {
delete this.visibleObjects[entity.id];
}
this._visibleObjectIds = null; // Lazy regenerate
this.fire("objectVisibility", entity, true);
if (notify) {
this.fire("objectVisibility", entity, true);
}
}

_objectXRayedUpdated(entity) {
Expand Down

0 comments on commit d70cfb5

Please sign in to comment.