David Catuhe 7 years ago
parent
commit
22e623d929

File diff suppressed because it is too large
+ 3441 - 3438
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 8441 - 8438
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.js


+ 29 - 5
dist/preview release/babylon.max.js

@@ -40911,6 +40911,8 @@ var BABYLON;
             if (this._indexBuffer) {
             if (this._indexBuffer) {
                 this._indexBuffer.references = numOfMeshes;
                 this._indexBuffer.references = numOfMeshes;
             }
             }
+            // morphTargets
+            mesh._syncGeometryWithMorphTargetManager();
         };
         };
         Geometry.prototype.notifyUpdate = function (kind) {
         Geometry.prototype.notifyUpdate = function (kind) {
             if (this.onGeometryUpdated) {
             if (this.onGeometryUpdated) {
@@ -102922,6 +102924,8 @@ var BABYLON;
              * Observable raised when the influence changes
              * Observable raised when the influence changes
              */
              */
             this.onInfluenceChanged = new BABYLON.Observable();
             this.onInfluenceChanged = new BABYLON.Observable();
+            /** @hidden */
+            this._onDataLayoutChanged = new BABYLON.Observable();
             this._animationPropertiesOverride = null;
             this._animationPropertiesOverride = null;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this.influence = influence;
             this.influence = influence;
@@ -102997,7 +103001,11 @@ var BABYLON;
          * @param data defines the position data to use
          * @param data defines the position data to use
          */
          */
         MorphTarget.prototype.setPositions = function (data) {
         MorphTarget.prototype.setPositions = function (data) {
+            var hadPositions = this.hasPositions;
             this._positions = data;
             this._positions = data;
+            if (hadPositions !== this.hasPositions) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the position data stored in this target
          * Gets the position data stored in this target
@@ -103011,7 +103019,11 @@ var BABYLON;
          * @param data defines the normal data to use
          * @param data defines the normal data to use
          */
          */
         MorphTarget.prototype.setNormals = function (data) {
         MorphTarget.prototype.setNormals = function (data) {
+            var hadNormals = this.hasNormals;
             this._normals = data;
             this._normals = data;
+            if (hadNormals !== this.hasNormals) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the normal data stored in this target
          * Gets the normal data stored in this target
@@ -103025,7 +103037,11 @@ var BABYLON;
          * @param data defines the tangent data to use
          * @param data defines the tangent data to use
          */
          */
         MorphTarget.prototype.setTangents = function (data) {
         MorphTarget.prototype.setTangents = function (data) {
+            var hadTangents = this.hasTangents;
             this._tangents = data;
             this._tangents = data;
+            if (hadTangents !== this.hasTangents) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the tangent data stored in this target
          * Gets the tangent data stored in this target
@@ -103119,7 +103135,8 @@ var BABYLON;
         function MorphTargetManager(scene) {
         function MorphTargetManager(scene) {
             if (scene === void 0) { scene = null; }
             if (scene === void 0) { scene = null; }
             this._targets = new Array();
             this._targets = new Array();
-            this._targetObservable = new Array();
+            this._targetInfluenceChangedObservers = new Array();
+            this._targetDataLayoutChangedObservers = new Array();
             this._activeTargets = new BABYLON.SmartArray(16);
             this._activeTargets = new BABYLON.SmartArray(16);
             this._supportsNormals = false;
             this._supportsNormals = false;
             this._supportsTangents = false;
             this._supportsTangents = false;
@@ -103228,9 +103245,12 @@ var BABYLON;
         MorphTargetManager.prototype.addTarget = function (target) {
         MorphTargetManager.prototype.addTarget = function (target) {
             var _this = this;
             var _this = this;
             this._targets.push(target);
             this._targets.push(target);
-            this._targetObservable.push(target.onInfluenceChanged.add(function (needUpdate) {
+            this._targetInfluenceChangedObservers.push(target.onInfluenceChanged.add(function (needUpdate) {
                 _this._syncActiveTargets(needUpdate);
                 _this._syncActiveTargets(needUpdate);
             }));
             }));
+            this._targetDataLayoutChangedObservers.push(target._onDataLayoutChanged.add(function () {
+                _this._syncActiveTargets(true);
+            }));
             this._syncActiveTargets(true);
             this._syncActiveTargets(true);
         };
         };
         /**
         /**
@@ -103241,7 +103261,8 @@ var BABYLON;
             var index = this._targets.indexOf(target);
             var index = this._targets.indexOf(target);
             if (index >= 0) {
             if (index >= 0) {
                 this._targets.splice(index, 1);
                 this._targets.splice(index, 1);
-                target.onInfluenceChanged.remove(this._targetObservable.splice(index, 1)[0]);
+                target.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(index, 1)[0]);
+                target._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(index, 1)[0]);
                 this._syncActiveTargets(true);
                 this._syncActiveTargets(true);
             }
             }
         };
         };
@@ -103267,12 +103288,15 @@ var BABYLON;
             this._vertexCount = 0;
             this._vertexCount = 0;
             for (var _i = 0, _a = this._targets; _i < _a.length; _i++) {
             for (var _i = 0, _a = this._targets; _i < _a.length; _i++) {
                 var target = _a[_i];
                 var target = _a[_i];
+                if (target.influence === 0) {
+                    continue;
+                }
                 this._activeTargets.push(target);
                 this._activeTargets.push(target);
                 this._tempInfluences[influenceCount++] = target.influence;
                 this._tempInfluences[influenceCount++] = target.influence;
+                this._supportsNormals = this._supportsNormals && target.hasNormals;
+                this._supportsTangents = this._supportsTangents && target.hasTangents;
                 var positions = target.getPositions();
                 var positions = target.getPositions();
                 if (positions) {
                 if (positions) {
-                    this._supportsNormals = this._supportsNormals && target.hasNormals;
-                    this._supportsTangents = this._supportsTangents && target.hasTangents;
                     var vertexCount = positions.length / 3;
                     var vertexCount = positions.length / 3;
                     if (this._vertexCount === 0) {
                     if (this._vertexCount === 0) {
                         this._vertexCount = vertexCount;
                         this._vertexCount = vertexCount;

+ 29 - 5
dist/preview release/babylon.no-module.max.js

@@ -40878,6 +40878,8 @@ var BABYLON;
             if (this._indexBuffer) {
             if (this._indexBuffer) {
                 this._indexBuffer.references = numOfMeshes;
                 this._indexBuffer.references = numOfMeshes;
             }
             }
+            // morphTargets
+            mesh._syncGeometryWithMorphTargetManager();
         };
         };
         Geometry.prototype.notifyUpdate = function (kind) {
         Geometry.prototype.notifyUpdate = function (kind) {
             if (this.onGeometryUpdated) {
             if (this.onGeometryUpdated) {
@@ -102889,6 +102891,8 @@ var BABYLON;
              * Observable raised when the influence changes
              * Observable raised when the influence changes
              */
              */
             this.onInfluenceChanged = new BABYLON.Observable();
             this.onInfluenceChanged = new BABYLON.Observable();
+            /** @hidden */
+            this._onDataLayoutChanged = new BABYLON.Observable();
             this._animationPropertiesOverride = null;
             this._animationPropertiesOverride = null;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this.influence = influence;
             this.influence = influence;
@@ -102964,7 +102968,11 @@ var BABYLON;
          * @param data defines the position data to use
          * @param data defines the position data to use
          */
          */
         MorphTarget.prototype.setPositions = function (data) {
         MorphTarget.prototype.setPositions = function (data) {
+            var hadPositions = this.hasPositions;
             this._positions = data;
             this._positions = data;
+            if (hadPositions !== this.hasPositions) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the position data stored in this target
          * Gets the position data stored in this target
@@ -102978,7 +102986,11 @@ var BABYLON;
          * @param data defines the normal data to use
          * @param data defines the normal data to use
          */
          */
         MorphTarget.prototype.setNormals = function (data) {
         MorphTarget.prototype.setNormals = function (data) {
+            var hadNormals = this.hasNormals;
             this._normals = data;
             this._normals = data;
+            if (hadNormals !== this.hasNormals) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the normal data stored in this target
          * Gets the normal data stored in this target
@@ -102992,7 +103004,11 @@ var BABYLON;
          * @param data defines the tangent data to use
          * @param data defines the tangent data to use
          */
          */
         MorphTarget.prototype.setTangents = function (data) {
         MorphTarget.prototype.setTangents = function (data) {
+            var hadTangents = this.hasTangents;
             this._tangents = data;
             this._tangents = data;
+            if (hadTangents !== this.hasTangents) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the tangent data stored in this target
          * Gets the tangent data stored in this target
@@ -103086,7 +103102,8 @@ var BABYLON;
         function MorphTargetManager(scene) {
         function MorphTargetManager(scene) {
             if (scene === void 0) { scene = null; }
             if (scene === void 0) { scene = null; }
             this._targets = new Array();
             this._targets = new Array();
-            this._targetObservable = new Array();
+            this._targetInfluenceChangedObservers = new Array();
+            this._targetDataLayoutChangedObservers = new Array();
             this._activeTargets = new BABYLON.SmartArray(16);
             this._activeTargets = new BABYLON.SmartArray(16);
             this._supportsNormals = false;
             this._supportsNormals = false;
             this._supportsTangents = false;
             this._supportsTangents = false;
@@ -103195,9 +103212,12 @@ var BABYLON;
         MorphTargetManager.prototype.addTarget = function (target) {
         MorphTargetManager.prototype.addTarget = function (target) {
             var _this = this;
             var _this = this;
             this._targets.push(target);
             this._targets.push(target);
-            this._targetObservable.push(target.onInfluenceChanged.add(function (needUpdate) {
+            this._targetInfluenceChangedObservers.push(target.onInfluenceChanged.add(function (needUpdate) {
                 _this._syncActiveTargets(needUpdate);
                 _this._syncActiveTargets(needUpdate);
             }));
             }));
+            this._targetDataLayoutChangedObservers.push(target._onDataLayoutChanged.add(function () {
+                _this._syncActiveTargets(true);
+            }));
             this._syncActiveTargets(true);
             this._syncActiveTargets(true);
         };
         };
         /**
         /**
@@ -103208,7 +103228,8 @@ var BABYLON;
             var index = this._targets.indexOf(target);
             var index = this._targets.indexOf(target);
             if (index >= 0) {
             if (index >= 0) {
                 this._targets.splice(index, 1);
                 this._targets.splice(index, 1);
-                target.onInfluenceChanged.remove(this._targetObservable.splice(index, 1)[0]);
+                target.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(index, 1)[0]);
+                target._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(index, 1)[0]);
                 this._syncActiveTargets(true);
                 this._syncActiveTargets(true);
             }
             }
         };
         };
@@ -103234,12 +103255,15 @@ var BABYLON;
             this._vertexCount = 0;
             this._vertexCount = 0;
             for (var _i = 0, _a = this._targets; _i < _a.length; _i++) {
             for (var _i = 0, _a = this._targets; _i < _a.length; _i++) {
                 var target = _a[_i];
                 var target = _a[_i];
+                if (target.influence === 0) {
+                    continue;
+                }
                 this._activeTargets.push(target);
                 this._activeTargets.push(target);
                 this._tempInfluences[influenceCount++] = target.influence;
                 this._tempInfluences[influenceCount++] = target.influence;
+                this._supportsNormals = this._supportsNormals && target.hasNormals;
+                this._supportsTangents = this._supportsTangents && target.hasTangents;
                 var positions = target.getPositions();
                 var positions = target.getPositions();
                 if (positions) {
                 if (positions) {
-                    this._supportsNormals = this._supportsNormals && target.hasNormals;
-                    this._supportsTangents = this._supportsTangents && target.hasTangents;
                     var vertexCount = positions.length / 3;
                     var vertexCount = positions.length / 3;
                     if (this._vertexCount === 0) {
                     if (this._vertexCount === 0) {
                         this._vertexCount = vertexCount;
                         this._vertexCount = vertexCount;

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.worker.js


+ 29 - 5
dist/preview release/es6.js

@@ -40878,6 +40878,8 @@ var BABYLON;
             if (this._indexBuffer) {
             if (this._indexBuffer) {
                 this._indexBuffer.references = numOfMeshes;
                 this._indexBuffer.references = numOfMeshes;
             }
             }
+            // morphTargets
+            mesh._syncGeometryWithMorphTargetManager();
         };
         };
         Geometry.prototype.notifyUpdate = function (kind) {
         Geometry.prototype.notifyUpdate = function (kind) {
             if (this.onGeometryUpdated) {
             if (this.onGeometryUpdated) {
@@ -102889,6 +102891,8 @@ var BABYLON;
              * Observable raised when the influence changes
              * Observable raised when the influence changes
              */
              */
             this.onInfluenceChanged = new BABYLON.Observable();
             this.onInfluenceChanged = new BABYLON.Observable();
+            /** @hidden */
+            this._onDataLayoutChanged = new BABYLON.Observable();
             this._animationPropertiesOverride = null;
             this._animationPropertiesOverride = null;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this.influence = influence;
             this.influence = influence;
@@ -102964,7 +102968,11 @@ var BABYLON;
          * @param data defines the position data to use
          * @param data defines the position data to use
          */
          */
         MorphTarget.prototype.setPositions = function (data) {
         MorphTarget.prototype.setPositions = function (data) {
+            var hadPositions = this.hasPositions;
             this._positions = data;
             this._positions = data;
+            if (hadPositions !== this.hasPositions) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the position data stored in this target
          * Gets the position data stored in this target
@@ -102978,7 +102986,11 @@ var BABYLON;
          * @param data defines the normal data to use
          * @param data defines the normal data to use
          */
          */
         MorphTarget.prototype.setNormals = function (data) {
         MorphTarget.prototype.setNormals = function (data) {
+            var hadNormals = this.hasNormals;
             this._normals = data;
             this._normals = data;
+            if (hadNormals !== this.hasNormals) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the normal data stored in this target
          * Gets the normal data stored in this target
@@ -102992,7 +103004,11 @@ var BABYLON;
          * @param data defines the tangent data to use
          * @param data defines the tangent data to use
          */
          */
         MorphTarget.prototype.setTangents = function (data) {
         MorphTarget.prototype.setTangents = function (data) {
+            var hadTangents = this.hasTangents;
             this._tangents = data;
             this._tangents = data;
+            if (hadTangents !== this.hasTangents) {
+                this._onDataLayoutChanged.notifyObservers(undefined);
+            }
         };
         };
         /**
         /**
          * Gets the tangent data stored in this target
          * Gets the tangent data stored in this target
@@ -103086,7 +103102,8 @@ var BABYLON;
         function MorphTargetManager(scene) {
         function MorphTargetManager(scene) {
             if (scene === void 0) { scene = null; }
             if (scene === void 0) { scene = null; }
             this._targets = new Array();
             this._targets = new Array();
-            this._targetObservable = new Array();
+            this._targetInfluenceChangedObservers = new Array();
+            this._targetDataLayoutChangedObservers = new Array();
             this._activeTargets = new BABYLON.SmartArray(16);
             this._activeTargets = new BABYLON.SmartArray(16);
             this._supportsNormals = false;
             this._supportsNormals = false;
             this._supportsTangents = false;
             this._supportsTangents = false;
@@ -103195,9 +103212,12 @@ var BABYLON;
         MorphTargetManager.prototype.addTarget = function (target) {
         MorphTargetManager.prototype.addTarget = function (target) {
             var _this = this;
             var _this = this;
             this._targets.push(target);
             this._targets.push(target);
-            this._targetObservable.push(target.onInfluenceChanged.add(function (needUpdate) {
+            this._targetInfluenceChangedObservers.push(target.onInfluenceChanged.add(function (needUpdate) {
                 _this._syncActiveTargets(needUpdate);
                 _this._syncActiveTargets(needUpdate);
             }));
             }));
+            this._targetDataLayoutChangedObservers.push(target._onDataLayoutChanged.add(function () {
+                _this._syncActiveTargets(true);
+            }));
             this._syncActiveTargets(true);
             this._syncActiveTargets(true);
         };
         };
         /**
         /**
@@ -103208,7 +103228,8 @@ var BABYLON;
             var index = this._targets.indexOf(target);
             var index = this._targets.indexOf(target);
             if (index >= 0) {
             if (index >= 0) {
                 this._targets.splice(index, 1);
                 this._targets.splice(index, 1);
-                target.onInfluenceChanged.remove(this._targetObservable.splice(index, 1)[0]);
+                target.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(index, 1)[0]);
+                target._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(index, 1)[0]);
                 this._syncActiveTargets(true);
                 this._syncActiveTargets(true);
             }
             }
         };
         };
@@ -103234,12 +103255,15 @@ var BABYLON;
             this._vertexCount = 0;
             this._vertexCount = 0;
             for (var _i = 0, _a = this._targets; _i < _a.length; _i++) {
             for (var _i = 0, _a = this._targets; _i < _a.length; _i++) {
                 var target = _a[_i];
                 var target = _a[_i];
+                if (target.influence === 0) {
+                    continue;
+                }
                 this._activeTargets.push(target);
                 this._activeTargets.push(target);
                 this._tempInfluences[influenceCount++] = target.influence;
                 this._tempInfluences[influenceCount++] = target.influence;
+                this._supportsNormals = this._supportsNormals && target.hasNormals;
+                this._supportsTangents = this._supportsTangents && target.hasTangents;
                 var positions = target.getPositions();
                 var positions = target.getPositions();
                 if (positions) {
                 if (positions) {
-                    this._supportsNormals = this._supportsNormals && target.hasNormals;
-                    this._supportsTangents = this._supportsTangents && target.hasTangents;
                     var vertexCount = positions.length / 3;
                     var vertexCount = positions.length / 3;
                     if (this._vertexCount === 0) {
                     if (this._vertexCount === 0) {
                         this._vertexCount = vertexCount;
                         this._vertexCount = vertexCount;

+ 1 - 1
dist/preview release/gui/babylon.gui.d.ts

@@ -1,6 +1,6 @@
 /*BabylonJS GUI*/
 /*BabylonJS GUI*/
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../Tools/Gulp/babylonjs
+//   ../../../../tools/gulp/babylonjs
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
 }
 }
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {

+ 2 - 2
dist/preview release/gui/babylon.gui.module.d.ts

@@ -1,6 +1,6 @@
 /*BabylonJS GUI*/
 /*BabylonJS GUI*/
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../Tools/Gulp/babylonjs
+//   ../../../../tools/gulp/babylonjs
 
 
 declare module 'babylonjs-gui' {
 declare module 'babylonjs-gui' {
     export * from "babylonjs-gui/2D";
     export * from "babylonjs-gui/2D";
@@ -2827,7 +2827,7 @@ declare module 'babylonjs-gui/3D/materials/fluentMaterial' {
 
 
 /*BabylonJS GUI*/
 /*BabylonJS GUI*/
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../Tools/Gulp/babylonjs
+//   ../../../../tools/gulp/babylonjs
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
 }
 }
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {

+ 1 - 1
dist/preview release/inspector/babylon.inspector.d.ts

@@ -1,6 +1,6 @@
 /*BabylonJS Inspector*/
 /*BabylonJS Inspector*/
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../Tools/Gulp/babylonjs
+//   ../../../../tools/gulp/babylonjs
 declare module INSPECTOR {
 declare module INSPECTOR {
 }
 }
 declare module INSPECTOR {
 declare module INSPECTOR {

+ 2 - 2
dist/preview release/inspector/babylon.inspector.module.d.ts

@@ -1,6 +1,6 @@
 /*BabylonJS Inspector*/
 /*BabylonJS Inspector*/
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../Tools/Gulp/babylonjs
+//   ../../../../tools/gulp/babylonjs
 
 
 declare module 'babylonjs-inspector' {
 declare module 'babylonjs-inspector' {
     export * from 'babylonjs-inspector/adapters';
     export * from 'babylonjs-inspector/adapters';
@@ -1343,7 +1343,7 @@ declare module 'babylonjs-inspector/treetools/SoundInteractions' {
 
 
 /*BabylonJS Inspector*/
 /*BabylonJS Inspector*/
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../Tools/Gulp/babylonjs
+//   ../../../../tools/gulp/babylonjs
 declare module INSPECTOR {
 declare module INSPECTOR {
 }
 }
 declare module INSPECTOR {
 declare module INSPECTOR {

+ 161 - 4
dist/preview release/viewer/babylon.viewer.d.ts

@@ -4,8 +4,8 @@
 declare module "babylonjs-loaders"{ export=BABYLON;}
 declare module "babylonjs-loaders"{ export=BABYLON;}
 // Generated by dts-bundle v0.7.3
 // Generated by dts-bundle v0.7.3
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../../Tools/Gulp/babylonjs
-//   ../../../../../Tools/Gulp/babylonjs-loaders
+//   ../../../../../tools/gulp/babylonjs
+//   ../../../../../tools/gulp/babylonjs-loaders
 declare module BabylonViewer {
 declare module BabylonViewer {
     /**
     /**
         * BabylonJS Viewer
         * BabylonJS Viewer
@@ -515,10 +515,167 @@ declare module BabylonViewer {
     }
     }
 }
 }
 declare module BabylonViewer {
 declare module BabylonViewer {
+    /**
+        * The current state of the model
+        */
+    export enum ModelState {
+            INIT = 0,
+            LOADING = 1,
+            LOADED = 2,
+            ENTRY = 3,
+            ENTRYDONE = 4,
+            COMPLETE = 5,
+            CANCELED = 6,
+            ERROR = 7
+    }
+    /**
+        * The viewer model is a container for all assets representing a sngle loaded model.
+        */
+    export class ViewerModel implements BABYLON.IDisposable {
+            /**
+                * The loader used to load this model.
+                */
+            loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync;
+            /**
+                * This model's root mesh (the parent of all other meshes).
+                * This mesh does not(!) exist in the meshes array.
+                */
+            rootMesh: BABYLON.AbstractMesh;
+            /**
+                * ParticleSystems connected to this model
+                */
+            particleSystems: Array<BABYLON.IParticleSystem>;
+            /**
+                * Skeletons defined in this model
+                */
+            skeletons: Array<BABYLON.Skeleton>;
+            /**
+                * The current model animation.
+                * On init, this will be undefined.
+                */
+            currentAnimation: IModelAnimation;
+            /**
+                * Observers registered here will be executed when the model is done loading
+                */
+            onLoadedObservable: BABYLON.Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed when the loader notified of a progress event
+                */
+            onLoadProgressObservable: BABYLON.Observable<BABYLON.SceneLoaderProgressEvent>;
+            /**
+                * Observers registered here will be executed when the loader notified of an error.
+                */
+            onLoadErrorObservable: BABYLON.Observable<{
+                    message: string;
+                    exception: any;
+            }>;
+            /**
+                * Will be executed after the model finished loading and complete, including entry animation and lod
+                */
+            onCompleteObservable: BABYLON.Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed every time the model is being configured.
+                * This can be used to extend the model's configuration without extending the class itself
+                */
+            onAfterConfigure: BABYLON.Observable<ViewerModel>;
+            /**
+                * The current model state (loaded, error, etc)
+                */
+            state: ModelState;
+            /**
+                * A loadID provided by the modelLoader, unique to ths (Abstract)Viewer instance.
+                */
+            loadId: number;
+            loadInfo: BABYLON.GLTF2.IAsset;
+            constructor(_observablesManager: ObservablesManager, modelConfiguration: IModelConfiguration, _configurationContainer?: ConfigurationContainer | undefined);
+            shadowsRenderedAfterLoad: boolean;
+            getViewerId(): string | undefined;
+            /**
+             * Set whether this model is enabled or not.
+             */
+            enabled: boolean;
+            loaderDone: boolean;
+            /**
+                * Add a mesh to this model.
+                * Any mesh that has no parent will be provided with the root mesh as its new parent.
+                *
+                * @param mesh the new mesh to add
+                * @param triggerLoaded should this mesh trigger the onLoaded observable. Used when adding meshes manually.
+                */
+            addMesh(mesh: BABYLON.AbstractMesh, triggerLoaded?: boolean): Promise<ViewerModel> | undefined;
+            /**
+                * get the list of meshes (excluding the root mesh)
+                */
+            readonly meshes: BABYLON.AbstractMesh[];
+            /**
+             * (Re-)set the model's entire configuration
+             * @param newConfiguration the new configuration to replace the new one
+             */
+            configuration: IModelConfiguration;
+            /**
+                * Update the current configuration with new values.
+                * Configuration will not be overwritten, but merged with the new configuration.
+                * Priority is to the new configuration
+                * @param newConfiguration the configuration to be merged into the current configuration;
+                */
+            updateConfiguration(newConfiguration: Partial<IModelConfiguration>): void;
+            /**
+                * Add a new animation group to this model.
+                * @param animationGroup the new animation group to be added
+                */
+            addAnimationGroup(animationGroup: BABYLON.AnimationGroup): void;
+            /**
+                * Get the ModelAnimation array
+                */
+            getAnimations(): Array<IModelAnimation>;
+            /**
+                * Get the animations' names. Using the names you can play a specific animation.
+                */
+            getAnimationNames(): Array<string>;
+            /**
+                * Get an animation by the provided name. Used mainly when playing n animation.
+                * @param name the name of the animation to find
+                */
+            protected _getAnimationByName(name: string): BABYLON.Nullable<IModelAnimation>;
+            /**
+                * Choose an initialized animation using its name and start playing it
+                * @param name the name of the animation to play
+                * @returns The model aniamtion to be played.
+                */
+            playAnimation(name: string): IModelAnimation;
+            setCurrentAnimationByName(name: string): IModelAnimation;
+            /**
+                * Apply a material configuration to a material
+                * @param material BABYLON.Material to apply configuration to
+                * @hidden
+                */
+            _applyModelMaterialConfiguration(material: BABYLON.Material): void;
+            /**
+             * Begin @animations with the specified @easingFunction
+             * @param animations The BABYLON Animations to begin
+             * @param duration of transition, in seconds
+             * @param easingFunction An easing function to apply
+             * @param easingMode A easing mode to apply to the easingFunction
+             * @param onAnimationEnd Call back trigger at the end of the animation.
+             */
+            transitionTo(animations: BABYLON.Animation[], duration: number, easingFunction: any, easingMode: number | undefined, onAnimationEnd: () => void): void;
+            /**
+                * Stops and removes all animations that have been applied to the model
+                */
+            stopAllAnimations(): void;
+            /**
+                * Will remove this model from the viewer (but NOT dispose it).
+                */
+            remove(): void;
+            /**
+                * Dispose this model, including all of its associated assets.
+                */
+            dispose(): void;
+    }
 }
 }
 declare module BabylonViewer {
 declare module BabylonViewer {
     /**
     /**
-        * Animation play mode enum - is the animation looping or playing once
+        * BABYLON.Animation play mode enum - is the animation looping or playing once
         */
         */
     export const enum AnimationPlayMode {
     export const enum AnimationPlayMode {
             ONCE = 0,
             ONCE = 0,
@@ -600,7 +757,7 @@ declare module BabylonViewer {
                 */
                 */
             readonly currentFrame: number;
             readonly currentFrame: number;
             /**
             /**
-                * Animation's FPS value
+                * BABYLON.Animation's FPS value
                 */
                 */
             readonly fps: number;
             readonly fps: number;
             /**
             /**

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 12 - 12
dist/preview release/viewer/babylon.viewer.max.js


+ 165 - 3
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -5,8 +5,8 @@ declare module "babylonjs-loaders"{ export=BABYLON;}
 
 
 // Generated by dts-bundle v0.7.3
 // Generated by dts-bundle v0.7.3
 // Dependencies for this module:
 // Dependencies for this module:
-//   ../../../../../Tools/Gulp/babylonjs
-//   ../../../../../Tools/Gulp/babylonjs-loaders
+//   ../../../../../tools/gulp/babylonjs
+//   ../../../../../tools/gulp/babylonjs-loaders
 
 
 declare module 'babylonjs-viewer' {
 declare module 'babylonjs-viewer' {
     import { mapperManager } from 'babylonjs-viewer/configuration/mappers';
     import { mapperManager } from 'babylonjs-viewer/configuration/mappers';
@@ -566,7 +566,169 @@ declare module 'babylonjs-viewer/loader/modelLoader' {
 }
 }
 
 
 declare module 'babylonjs-viewer/model/viewerModel' {
 declare module 'babylonjs-viewer/model/viewerModel' {
-    
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, AnimationGroup, AbstractMesh, Observable, SceneLoaderProgressEvent, IParticleSystem, Skeleton, IDisposable, Nullable, Animation, Material } from "babylonjs";
+    import { GLTF2 } from "babylonjs-loaders";
+    import { IModelConfiguration } from "babylonjs-viewer/configuration/interfaces/modelConfiguration";
+    import { IModelAnimation } from "babylonjs-viewer/model/modelAnimation";
+    import { ObservablesManager } from "babylonjs-viewer/managers/observablesManager";
+    import { ConfigurationContainer } from "babylonjs-viewer/configuration/configurationContainer";
+    /**
+        * The current state of the model
+        */
+    export enum ModelState {
+            INIT = 0,
+            LOADING = 1,
+            LOADED = 2,
+            ENTRY = 3,
+            ENTRYDONE = 4,
+            COMPLETE = 5,
+            CANCELED = 6,
+            ERROR = 7
+    }
+    /**
+        * The viewer model is a container for all assets representing a sngle loaded model.
+        */
+    export class ViewerModel implements IDisposable {
+            /**
+                * The loader used to load this model.
+                */
+            loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync;
+            /**
+                * This model's root mesh (the parent of all other meshes).
+                * This mesh does not(!) exist in the meshes array.
+                */
+            rootMesh: AbstractMesh;
+            /**
+                * ParticleSystems connected to this model
+                */
+            particleSystems: Array<IParticleSystem>;
+            /**
+                * Skeletons defined in this model
+                */
+            skeletons: Array<Skeleton>;
+            /**
+                * The current model animation.
+                * On init, this will be undefined.
+                */
+            currentAnimation: IModelAnimation;
+            /**
+                * Observers registered here will be executed when the model is done loading
+                */
+            onLoadedObservable: Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed when the loader notified of a progress event
+                */
+            onLoadProgressObservable: Observable<SceneLoaderProgressEvent>;
+            /**
+                * Observers registered here will be executed when the loader notified of an error.
+                */
+            onLoadErrorObservable: Observable<{
+                    message: string;
+                    exception: any;
+            }>;
+            /**
+                * Will be executed after the model finished loading and complete, including entry animation and lod
+                */
+            onCompleteObservable: Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed every time the model is being configured.
+                * This can be used to extend the model's configuration without extending the class itself
+                */
+            onAfterConfigure: Observable<ViewerModel>;
+            /**
+                * The current model state (loaded, error, etc)
+                */
+            state: ModelState;
+            /**
+                * A loadID provided by the modelLoader, unique to ths (Abstract)Viewer instance.
+                */
+            loadId: number;
+            loadInfo: GLTF2.IAsset;
+            constructor(_observablesManager: ObservablesManager, modelConfiguration: IModelConfiguration, _configurationContainer?: ConfigurationContainer | undefined);
+            shadowsRenderedAfterLoad: boolean;
+            getViewerId(): string | undefined;
+            /**
+             * Set whether this model is enabled or not.
+             */
+            enabled: boolean;
+            loaderDone: boolean;
+            /**
+                * Add a mesh to this model.
+                * Any mesh that has no parent will be provided with the root mesh as its new parent.
+                *
+                * @param mesh the new mesh to add
+                * @param triggerLoaded should this mesh trigger the onLoaded observable. Used when adding meshes manually.
+                */
+            addMesh(mesh: AbstractMesh, triggerLoaded?: boolean): Promise<ViewerModel> | undefined;
+            /**
+                * get the list of meshes (excluding the root mesh)
+                */
+            readonly meshes: AbstractMesh[];
+            /**
+             * (Re-)set the model's entire configuration
+             * @param newConfiguration the new configuration to replace the new one
+             */
+            configuration: IModelConfiguration;
+            /**
+                * Update the current configuration with new values.
+                * Configuration will not be overwritten, but merged with the new configuration.
+                * Priority is to the new configuration
+                * @param newConfiguration the configuration to be merged into the current configuration;
+                */
+            updateConfiguration(newConfiguration: Partial<IModelConfiguration>): void;
+            /**
+                * Add a new animation group to this model.
+                * @param animationGroup the new animation group to be added
+                */
+            addAnimationGroup(animationGroup: AnimationGroup): void;
+            /**
+                * Get the ModelAnimation array
+                */
+            getAnimations(): Array<IModelAnimation>;
+            /**
+                * Get the animations' names. Using the names you can play a specific animation.
+                */
+            getAnimationNames(): Array<string>;
+            /**
+                * Get an animation by the provided name. Used mainly when playing n animation.
+                * @param name the name of the animation to find
+                */
+            protected _getAnimationByName(name: string): Nullable<IModelAnimation>;
+            /**
+                * Choose an initialized animation using its name and start playing it
+                * @param name the name of the animation to play
+                * @returns The model aniamtion to be played.
+                */
+            playAnimation(name: string): IModelAnimation;
+            setCurrentAnimationByName(name: string): IModelAnimation;
+            /**
+                * Apply a material configuration to a material
+                * @param material Material to apply configuration to
+                * @hidden
+                */
+            _applyModelMaterialConfiguration(material: Material): void;
+            /**
+             * Begin @animations with the specified @easingFunction
+             * @param animations The BABYLON Animations to begin
+             * @param duration of transition, in seconds
+             * @param easingFunction An easing function to apply
+             * @param easingMode A easing mode to apply to the easingFunction
+             * @param onAnimationEnd Call back trigger at the end of the animation.
+             */
+            transitionTo(animations: Animation[], duration: number, easingFunction: any, easingMode: number | undefined, onAnimationEnd: () => void): void;
+            /**
+                * Stops and removes all animations that have been applied to the model
+                */
+            stopAllAnimations(): void;
+            /**
+                * Will remove this model from the viewer (but NOT dispose it).
+                */
+            remove(): void;
+            /**
+                * Dispose this model, including all of its associated assets.
+                */
+            dispose(): void;
+    }
 }
 }
 
 
 declare module 'babylonjs-viewer/model/modelAnimation' {
 declare module 'babylonjs-viewer/model/modelAnimation' {