|
@@ -93315,11 +93315,17 @@ var ViewerManager = (function () {
|
|
|
function ViewerManager() {
|
|
|
this.viewers = {};
|
|
|
this.onViewerAddedObservable = new babylonjs_1.Observable();
|
|
|
+ this.onViewerRemovedObservable = new babylonjs_1.Observable();
|
|
|
}
|
|
|
ViewerManager.prototype.addViewer = function (viewer) {
|
|
|
this.viewers[viewer.getBaseId()] = viewer;
|
|
|
this._onViewerAdded(viewer);
|
|
|
};
|
|
|
+ ViewerManager.prototype.removeViewer = function (viewer) {
|
|
|
+ var id = viewer.getBaseId();
|
|
|
+ delete this.viewers[id];
|
|
|
+ this.onViewerRemovedObservable.notifyObservers(id);
|
|
|
+ };
|
|
|
ViewerManager.prototype.getViewerById = function (id) {
|
|
|
return this.viewers[id];
|
|
|
};
|
|
@@ -93582,7 +93588,7 @@ var DefaultViewer = (function (_super) {
|
|
|
if (lightsConfiguration === void 0) { lightsConfiguration = {}; }
|
|
|
_super.prototype.configureLights.call(this, lightsConfiguration, model);
|
|
|
if (this.configuration.lab && this.configuration.lab.flashlight) {
|
|
|
- var pointerPosition = BABYLON.Vector3.Zero();
|
|
|
+ var pointerPosition = babylonjs_1.Vector3.Zero();
|
|
|
var lightTarget_1;
|
|
|
var angle = 0.5;
|
|
|
var exponent = Math.PI / 2;
|
|
@@ -93648,6 +93654,7 @@ var AbstractViewer = (function () {
|
|
|
if (initialConfiguration === void 0) { initialConfiguration = {}; }
|
|
|
var _this = this;
|
|
|
this.containerElement = containerElement;
|
|
|
+ this._isDisposed = false;
|
|
|
this.resize = function () {
|
|
|
if (!_this.isCanvasInDOM()) {
|
|
|
return;
|
|
@@ -94172,6 +94179,7 @@ var AbstractViewer = (function () {
|
|
|
this.scene.dispose();
|
|
|
this.engine.dispose();
|
|
|
this.templateManager.dispose();
|
|
|
+ viewerManager_1.viewerManager.removeViewer(this);
|
|
|
this._isDisposed = true;
|
|
|
};
|
|
|
AbstractViewer.prototype.onTemplatesLoaded = function () {
|
|
@@ -95407,7 +95415,7 @@ var ViewerModel = (function () {
|
|
|
}
|
|
|
else {
|
|
|
skeletons.forEach(function (skeleton, idx) {
|
|
|
- var ag = new BABYLON.AnimationGroup("animation-" + idx, _this._scene);
|
|
|
+ var ag = new babylonjs_1.AnimationGroup("animation-" + idx, _this._scene);
|
|
|
skeleton.getAnimatables().forEach(function (a) {
|
|
|
if (a.animations[0]) {
|
|
|
ag.addTargetedAnimation(a.animations[0], a);
|