David Catuhe 7 年之前
父節點
當前提交
e865a88ae5

文件差異過大導致無法顯示
+ 14114 - 14111
Playground/babylon.d.txt


文件差異過大導致無法顯示
+ 9567 - 9564
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 25 - 25
dist/preview release/babylon.js


+ 18 - 1
dist/preview release/babylon.max.js

@@ -50587,6 +50587,10 @@ var BABYLON;
              */
              */
             this.isDone = false;
             this.isDone = false;
         }
         }
+        /** @hidden */
+        AnimationEvent.prototype._clone = function () {
+            return new AnimationEvent(this.frame, this.action, this.onlyOnce);
+        };
         return AnimationEvent;
         return AnimationEvent;
     }());
     }());
     BABYLON.AnimationEvent = AnimationEvent;
     BABYLON.AnimationEvent = AnimationEvent;
@@ -51989,6 +51993,8 @@ var BABYLON;
          * @param host defines the initiating Animatable
          * @param host defines the initiating Animatable
          */
          */
         function RuntimeAnimation(target, animation, scene, host) {
         function RuntimeAnimation(target, animation, scene, host) {
+            var _this = this;
+            this._events = new Array();
             /**
             /**
              * The current frame of the runtime animation
              * The current frame of the runtime animation
              */
              */
@@ -52038,6 +52044,13 @@ var BABYLON;
             this._scene = scene;
             this._scene = scene;
             this._host = host;
             this._host = host;
             animation._runtimeAnimations.push(this);
             animation._runtimeAnimations.push(this);
+            // Cloning events locally
+            var events = animation.getEvents();
+            if (events && events.length > 0) {
+                events.forEach(function (e) {
+                    _this._events.push(e._clone());
+                });
+            }
         }
         }
         Object.defineProperty(RuntimeAnimation.prototype, "currentFrame", {
         Object.defineProperty(RuntimeAnimation.prototype, "currentFrame", {
             /**
             /**
@@ -52127,6 +52140,10 @@ var BABYLON;
             this._currentFrame = 0;
             this._currentFrame = 0;
             this._blendingFactor = 0;
             this._blendingFactor = 0;
             this._originalValue = new Array();
             this._originalValue = new Array();
+            // Events
+            for (var index = 0; index < this._events.length; index++) {
+                this._events[index].isDone = false;
+            }
         };
         };
         /**
         /**
          * Specifies if the runtime animation is stopped
          * Specifies if the runtime animation is stopped
@@ -52422,7 +52439,7 @@ var BABYLON;
                 currentFrame = from + (to - from) * hostNormalizedFrame;
                 currentFrame = from + (to - from) * hostNormalizedFrame;
             }
             }
             // Reset events if looping
             // Reset events if looping
-            var events = this._animation.getEvents();
+            var events = this._events;
             if (range > 0 && this.currentFrame > currentFrame ||
             if (range > 0 && this.currentFrame > currentFrame ||
                 range < 0 && this.currentFrame < currentFrame) {
                 range < 0 && this.currentFrame < currentFrame) {
                 // Need to reset animation events
                 // Need to reset animation events

+ 18 - 1
dist/preview release/babylon.no-module.max.js

@@ -50554,6 +50554,10 @@ var BABYLON;
              */
              */
             this.isDone = false;
             this.isDone = false;
         }
         }
+        /** @hidden */
+        AnimationEvent.prototype._clone = function () {
+            return new AnimationEvent(this.frame, this.action, this.onlyOnce);
+        };
         return AnimationEvent;
         return AnimationEvent;
     }());
     }());
     BABYLON.AnimationEvent = AnimationEvent;
     BABYLON.AnimationEvent = AnimationEvent;
@@ -51956,6 +51960,8 @@ var BABYLON;
          * @param host defines the initiating Animatable
          * @param host defines the initiating Animatable
          */
          */
         function RuntimeAnimation(target, animation, scene, host) {
         function RuntimeAnimation(target, animation, scene, host) {
+            var _this = this;
+            this._events = new Array();
             /**
             /**
              * The current frame of the runtime animation
              * The current frame of the runtime animation
              */
              */
@@ -52005,6 +52011,13 @@ var BABYLON;
             this._scene = scene;
             this._scene = scene;
             this._host = host;
             this._host = host;
             animation._runtimeAnimations.push(this);
             animation._runtimeAnimations.push(this);
+            // Cloning events locally
+            var events = animation.getEvents();
+            if (events && events.length > 0) {
+                events.forEach(function (e) {
+                    _this._events.push(e._clone());
+                });
+            }
         }
         }
         Object.defineProperty(RuntimeAnimation.prototype, "currentFrame", {
         Object.defineProperty(RuntimeAnimation.prototype, "currentFrame", {
             /**
             /**
@@ -52094,6 +52107,10 @@ var BABYLON;
             this._currentFrame = 0;
             this._currentFrame = 0;
             this._blendingFactor = 0;
             this._blendingFactor = 0;
             this._originalValue = new Array();
             this._originalValue = new Array();
+            // Events
+            for (var index = 0; index < this._events.length; index++) {
+                this._events[index].isDone = false;
+            }
         };
         };
         /**
         /**
          * Specifies if the runtime animation is stopped
          * Specifies if the runtime animation is stopped
@@ -52389,7 +52406,7 @@ var BABYLON;
                 currentFrame = from + (to - from) * hostNormalizedFrame;
                 currentFrame = from + (to - from) * hostNormalizedFrame;
             }
             }
             // Reset events if looping
             // Reset events if looping
-            var events = this._animation.getEvents();
+            var events = this._events;
             if (range > 0 && this.currentFrame > currentFrame ||
             if (range > 0 && this.currentFrame > currentFrame ||
                 range < 0 && this.currentFrame < currentFrame) {
                 range < 0 && this.currentFrame < currentFrame) {
                 // Need to reset animation events
                 // Need to reset animation events

文件差異過大導致無法顯示
+ 25 - 25
dist/preview release/babylon.worker.js


+ 18 - 1
dist/preview release/es6.js

@@ -50554,6 +50554,10 @@ var BABYLON;
              */
              */
             this.isDone = false;
             this.isDone = false;
         }
         }
+        /** @hidden */
+        AnimationEvent.prototype._clone = function () {
+            return new AnimationEvent(this.frame, this.action, this.onlyOnce);
+        };
         return AnimationEvent;
         return AnimationEvent;
     }());
     }());
     BABYLON.AnimationEvent = AnimationEvent;
     BABYLON.AnimationEvent = AnimationEvent;
@@ -51956,6 +51960,8 @@ var BABYLON;
          * @param host defines the initiating Animatable
          * @param host defines the initiating Animatable
          */
          */
         function RuntimeAnimation(target, animation, scene, host) {
         function RuntimeAnimation(target, animation, scene, host) {
+            var _this = this;
+            this._events = new Array();
             /**
             /**
              * The current frame of the runtime animation
              * The current frame of the runtime animation
              */
              */
@@ -52005,6 +52011,13 @@ var BABYLON;
             this._scene = scene;
             this._scene = scene;
             this._host = host;
             this._host = host;
             animation._runtimeAnimations.push(this);
             animation._runtimeAnimations.push(this);
+            // Cloning events locally
+            var events = animation.getEvents();
+            if (events && events.length > 0) {
+                events.forEach(function (e) {
+                    _this._events.push(e._clone());
+                });
+            }
         }
         }
         Object.defineProperty(RuntimeAnimation.prototype, "currentFrame", {
         Object.defineProperty(RuntimeAnimation.prototype, "currentFrame", {
             /**
             /**
@@ -52094,6 +52107,10 @@ var BABYLON;
             this._currentFrame = 0;
             this._currentFrame = 0;
             this._blendingFactor = 0;
             this._blendingFactor = 0;
             this._originalValue = new Array();
             this._originalValue = new Array();
+            // Events
+            for (var index = 0; index < this._events.length; index++) {
+                this._events[index].isDone = false;
+            }
         };
         };
         /**
         /**
          * Specifies if the runtime animation is stopped
          * Specifies if the runtime animation is stopped
@@ -52389,7 +52406,7 @@ var BABYLON;
                 currentFrame = from + (to - from) * hostNormalizedFrame;
                 currentFrame = from + (to - from) * hostNormalizedFrame;
             }
             }
             // Reset events if looping
             // Reset events if looping
-            var events = this._animation.getEvents();
+            var events = this._events;
             if (range > 0 && this.currentFrame > currentFrame ||
             if (range > 0 && this.currentFrame > currentFrame ||
                 range < 0 && this.currentFrame < currentFrame) {
                 range < 0 && this.currentFrame < currentFrame) {
                 // Need to reset animation events
                 // Need to reset animation events

+ 5 - 0
dist/preview release/viewer/babylon.viewer.d.ts

@@ -35,6 +35,7 @@ declare module BabylonViewer {
     function disposeAll(): void;
     function disposeAll(): void;
     const Version: string;
     const Version: string;
     
     
+    export * from 'babylonjs-viewer/configuration';
 }
 }
 
 
 declare module BabylonViewer {
 declare module BabylonViewer {
@@ -942,6 +943,10 @@ declare module BabylonViewer {
 }
 }
 
 
 declare module BabylonViewer {
 declare module BabylonViewer {
+    export * from 'babylonjs-viewer/configuration/configuration';
+}
+
+declare module BabylonViewer {
     
     
     
     
     export function getConfigurationKey(key: string, configObject: any): any;
     export function getConfigurationKey(key: string, configObject: any): any;

文件差異過大導致無法顯示
+ 37 - 37
dist/preview release/viewer/babylon.viewer.js


文件差異過大導致無法顯示
+ 122 - 78
dist/preview release/viewer/babylon.viewer.max.js


+ 6 - 0
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -35,6 +35,7 @@ declare module 'babylonjs-viewer' {
     function disposeAll(): void;
     function disposeAll(): void;
     const Version: string;
     const Version: string;
     export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin };
     export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin };
+    export * from 'babylonjs-viewer/configuration';
 }
 }
 
 
 declare module 'babylonjs-viewer/configuration/mappers' {
 declare module 'babylonjs-viewer/configuration/mappers' {
@@ -941,6 +942,10 @@ declare module 'babylonjs-viewer/initializer' {
     export function InitTags(selector?: string): void;
     export function InitTags(selector?: string): void;
 }
 }
 
 
+declare module 'babylonjs-viewer/configuration' {
+    export * from 'babylonjs-viewer/configuration/configuration';
+}
+
 declare module 'babylonjs-viewer/configuration/configuration' {
 declare module 'babylonjs-viewer/configuration/configuration' {
     import { ITemplateConfiguration } from 'babylonjs-viewer/templateManager';
     import { ITemplateConfiguration } from 'babylonjs-viewer/templateManager';
     import { EngineOptions, IGlowLayerOptions, DepthOfFieldEffectBlurLevel } from 'babylonjs';
     import { EngineOptions, IGlowLayerOptions, DepthOfFieldEffectBlurLevel } from 'babylonjs';
@@ -1929,6 +1934,7 @@ declare module 'babylonjs-viewer/' {
     function disposeAll(): void;
     function disposeAll(): void;
     const Version: string;
     const Version: string;
     export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin };
     export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin };
+    export * from 'babylonjs-viewer/configuration';
 }
 }
 
 
 declare module 'babylonjs-viewer/eventManager' {
 declare module 'babylonjs-viewer/eventManager' {

+ 5 - 0
src/Animations/babylon.animation.ts

@@ -50,6 +50,11 @@
             /** Specifies if the event should be triggered only once**/
             /** Specifies if the event should be triggered only once**/
             public onlyOnce?: boolean ) {
             public onlyOnce?: boolean ) {
         }
         }
+
+        /** @hidden */
+        public _clone(): AnimationEvent {
+            return new AnimationEvent(this.frame, this.action, this.onlyOnce);
+        }
     }
     }
 
 
     /**
     /**

+ 16 - 1
src/Animations/babylon.runtimeAnimation.ts

@@ -4,6 +4,8 @@
      * Defines a runtime animation
      * Defines a runtime animation
      */
      */
     export class RuntimeAnimation {
     export class RuntimeAnimation {
+        private _events = new Array<AnimationEvent>();
+
         /**
         /**
          * The current frame of the runtime animation
          * The current frame of the runtime animation
          */
          */
@@ -146,6 +148,14 @@
             this._host = host;
             this._host = host;
 
 
             animation._runtimeAnimations.push(this);
             animation._runtimeAnimations.push(this);
+
+            // Cloning events locally
+            var events = animation.getEvents();
+            if (events && events.length > 0) {
+                events.forEach((e) => {
+                    this._events.push(e._clone());
+                });
+            }
         }
         }
 
 
         /**
         /**
@@ -182,6 +192,11 @@
             this._currentFrame = 0;
             this._currentFrame = 0;
             this._blendingFactor = 0;
             this._blendingFactor = 0;
             this._originalValue = new Array<any>();
             this._originalValue = new Array<any>();
+
+            // Events
+            for (var index = 0; index < this._events.length; index++) {
+                this._events[index].isDone = false;
+            }                  
         }
         }
 
 
         /**
         /**
@@ -505,7 +520,7 @@
             }
             }
 
 
             // Reset events if looping
             // Reset events if looping
-            let events = this._animation.getEvents();
+            let events = this._events;
             if (range > 0 && this.currentFrame > currentFrame || 
             if (range > 0 && this.currentFrame > currentFrame || 
                 range < 0 && this.currentFrame < currentFrame) {
                 range < 0 && this.currentFrame < currentFrame) {
                     // Need to reset animation events
                     // Need to reset animation events