Bläddra i källkod

Merge pull request #6269 from BabylonJS/master

Nightly
David Catuhe 6 år sedan
förälder
incheckning
20b200f616

+ 5 - 0
Playground/babylon.d.txt

@@ -31101,6 +31101,7 @@ declare module BABYLON {
         private _isStarted;
         private _isPaused;
         private _speedRatio;
+        private _loopAnimation;
         /**
          * Gets or sets the unique id of the node
          */
@@ -31149,6 +31150,10 @@ declare module BABYLON {
         */
         speedRatio: number;
         /**
+         * Gets or sets if all animations should loop or not
+         */
+        loopAnimation: boolean;
+        /**
          * Gets the targeted animations for this animation group
          */
         readonly targetedAnimations: Array<TargetedAnimation>;

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

@@ -31694,6 +31694,7 @@ declare module BABYLON {
         private _isStarted;
         private _isPaused;
         private _speedRatio;
+        private _loopAnimation;
         /**
          * Gets or sets the unique id of the node
          */
@@ -31742,6 +31743,10 @@ declare module BABYLON {
         */
         speedRatio: number;
         /**
+         * Gets or sets if all animations should loop or not
+         */
+        loopAnimation: boolean;
+        /**
          * Gets the targeted animations for this animation group
          */
         readonly targetedAnimations: Array<TargetedAnimation>;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/babylon.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 54 - 35
dist/preview release/babylon.max.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/babylon.max.js.map


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

@@ -32518,6 +32518,7 @@ declare module "babylonjs/Animations/animationGroup" {
         private _isStarted;
         private _isPaused;
         private _speedRatio;
+        private _loopAnimation;
         /**
          * Gets or sets the unique id of the node
          */
@@ -32566,6 +32567,10 @@ declare module "babylonjs/Animations/animationGroup" {
         */
         speedRatio: number;
         /**
+         * Gets or sets if all animations should loop or not
+         */
+        loopAnimation: boolean;
+        /**
          * Gets the targeted animations for this animation group
          */
         readonly targetedAnimations: Array<TargetedAnimation>;
@@ -91695,6 +91700,7 @@ declare module BABYLON {
         private _isStarted;
         private _isPaused;
         private _speedRatio;
+        private _loopAnimation;
         /**
          * Gets or sets the unique id of the node
          */
@@ -91743,6 +91749,10 @@ declare module BABYLON {
         */
         speedRatio: number;
         /**
+         * Gets or sets if all animations should loop or not
+         */
+        loopAnimation: boolean;
+        /**
          * Gets the targeted animations for this animation group
          */
         readonly targetedAnimations: Array<TargetedAnimation>;

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

@@ -32518,6 +32518,7 @@ declare module "babylonjs/Animations/animationGroup" {
         private _isStarted;
         private _isPaused;
         private _speedRatio;
+        private _loopAnimation;
         /**
          * Gets or sets the unique id of the node
          */
@@ -32566,6 +32567,10 @@ declare module "babylonjs/Animations/animationGroup" {
         */
         speedRatio: number;
         /**
+         * Gets or sets if all animations should loop or not
+         */
+        loopAnimation: boolean;
+        /**
          * Gets the targeted animations for this animation group
          */
         readonly targetedAnimations: Array<TargetedAnimation>;
@@ -91695,6 +91700,7 @@ declare module BABYLON {
         private _isStarted;
         private _isPaused;
         private _speedRatio;
+        private _loopAnimation;
         /**
          * Gets or sets the unique id of the node
          */
@@ -91743,6 +91749,10 @@ declare module BABYLON {
         */
         speedRatio: number;
         /**
+         * Gets or sets if all animations should loop or not
+         */
+        loopAnimation: boolean;
+        /**
          * Gets the targeted animations for this animation group
          */
         readonly targetedAnimations: Array<TargetedAnimation>;

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

@@ -1237,6 +1237,15 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    export class ConfigurationContainer {
+        configuration: ViewerConfiguration;
+        viewerId: string;
+        mainColor: BABYLON.Color3;
+        reflectionColor: BABYLON.Color3;
+        scene?: BABYLON.Scene;
+    }
+}
+declare module BabylonViewer {
     /**
         * The configuration loader will load the configuration object from any source and will use the defined mapper to
         * parse the object and return a conform ViewerConfiguration.

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 6 - 6
dist/preview release/viewer/babylon.viewer.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 10 - 1
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -1341,7 +1341,16 @@ declare module 'babylonjs-viewer/viewer/viewerWithTemplate' {
 }
 
 declare module 'babylonjs-viewer/configuration/configurationContainer' {
-    
+    import { ViewerConfiguration } from 'babylonjs-viewer/configuration/configuration';
+    import { Color3 } from 'babylonjs/Maths/math';
+    import { Scene } from 'babylonjs/scene';
+    export class ConfigurationContainer {
+        configuration: ViewerConfiguration;
+        viewerId: string;
+        mainColor: Color3;
+        reflectionColor: Color3;
+        scene?: Scene;
+    }
 }
 
 declare module 'babylonjs-viewer/configuration/renderOnlyLoader' {

+ 24 - 4
src/Animations/animationGroup.ts

@@ -33,6 +33,7 @@ export class AnimationGroup implements IDisposable {
     private _isStarted: boolean;
     private _isPaused: boolean;
     private _speedRatio = 1;
+    private _loopAnimation = false;
 
     /**
      * Gets or sets the unique id of the node
@@ -116,6 +117,26 @@ export class AnimationGroup implements IDisposable {
     }
 
     /**
+     * Gets or sets if all animations should loop or not
+     */
+    public get loopAnimation(): boolean {
+        return this._loopAnimation;
+    }
+
+    public set loopAnimation(value: boolean) {
+        if (this._loopAnimation === value) {
+            return;
+        }
+
+        this._loopAnimation = value;
+
+        for (var index = 0; index < this._animatables.length; index++) {
+            let animatable = this._animatables[index];
+            animatable.loopAnimation = this._loopAnimation;
+        }
+    }
+
+    /**
      * Gets the targeted animations for this animation group
      */
     public get targetedAnimations(): Array<TargetedAnimation> {
@@ -231,6 +252,8 @@ export class AnimationGroup implements IDisposable {
             return this;
         }
 
+        this._loopAnimation = loop;
+
         for (const targetedAnimation of this._targetedAnimations) {
             let animatable = this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this._from, to !== undefined ? to : this._to, loop, speedRatio);
             animatable.onAnimationEnd = () => {
@@ -294,10 +317,7 @@ export class AnimationGroup implements IDisposable {
         // only if all animatables are ready and exist
         if (this.isStarted && this._animatables.length === this._targetedAnimations.length) {
             if (loop !== undefined) {
-                for (var index = 0; index < this._animatables.length; index++) {
-                    let animatable = this._animatables[index];
-                    animatable.loopAnimation = loop;
-                }
+                this.loopAnimation = loop;
             }
             this.restart();
         } else {