Browse Source

Fixed bug with scene.getAnimationRatio()

David Catuhe 9 years ago
parent
commit
8ba0d974fc

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


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


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


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

@@ -15206,7 +15206,6 @@ var BABYLON;
             this._particlesDuration = new BABYLON.PerfCounter();
             this._renderDuration = new BABYLON.PerfCounter();
             this._spritesDuration = new BABYLON.PerfCounter();
-            this._animationRatio = new BABYLON.PerfCounter();
             this._activeBones = new BABYLON.PerfCounter();
             this._renderId = 0;
             this._executeWhenReadyTimeoutId = -1;
@@ -15505,9 +15504,6 @@ var BABYLON;
             configurable: true
         });
         Scene.prototype.getAnimationRatio = function () {
-            return this._animationRatio.current;
-        };
-        Scene.prototype.animationRatioPerfCounter = function () {
             return this._animationRatio;
         };
         Scene.prototype.getRenderId = function () {
@@ -16749,7 +16745,7 @@ var BABYLON;
             }
             // Animations
             var deltaTime = Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime));
-            this._animationRatio.addCount(deltaTime * (60.0 / 1000.0), true);
+            this._animationRatio = deltaTime * (60.0 / 1000.0);
             this._animate();
             // Physics
             if (this._physicsEngine) {

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


+ 1 - 5
src/babylon.scene.js

@@ -291,7 +291,6 @@ var BABYLON;
             this._particlesDuration = new BABYLON.PerfCounter();
             this._renderDuration = new BABYLON.PerfCounter();
             this._spritesDuration = new BABYLON.PerfCounter();
-            this._animationRatio = new BABYLON.PerfCounter();
             this._activeBones = new BABYLON.PerfCounter();
             this._renderId = 0;
             this._executeWhenReadyTimeoutId = -1;
@@ -590,9 +589,6 @@ var BABYLON;
             configurable: true
         });
         Scene.prototype.getAnimationRatio = function () {
-            return this._animationRatio.current;
-        };
-        Scene.prototype.animationRatioPerfCounter = function () {
             return this._animationRatio;
         };
         Scene.prototype.getRenderId = function () {
@@ -1834,7 +1830,7 @@ var BABYLON;
             }
             // Animations
             var deltaTime = Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime));
-            this._animationRatio.addCount(deltaTime * (60.0 / 1000.0), true);
+            this._animationRatio = deltaTime * (60.0 / 1000.0);
             this._animate();
             // Physics
             if (this._physicsEngine) {

+ 3 - 6
src/babylon.scene.ts

@@ -434,9 +434,10 @@
         public  _particlesDuration            = new PerfCounter();
         private _renderDuration               = new PerfCounter();
         public  _spritesDuration              = new PerfCounter();
-        private _animationRatio               = new PerfCounter();
         public  _activeBones                  = new PerfCounter();
 
+        private _animationRatio: number;
+
         private _animationStartDate: number;
         public _cachedMaterial: Material;
 
@@ -672,10 +673,6 @@
         }
 
         public getAnimationRatio(): number {
-            return this._animationRatio.current;
-        }
-
-        public animationRatioPerfCounter(): PerfCounter {
             return this._animationRatio;
         }
 
@@ -2176,7 +2173,7 @@
 
             // Animations
             var deltaTime = Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime));
-            this._animationRatio.addCount(deltaTime * (60.0 / 1000.0), true);
+            this._animationRatio = deltaTime * (60.0 / 1000.0);
             this._animate();
 
             // Physics