David Catuhe 6 gadi atpakaļ
vecāks
revīzija
9cc8c3e7a3

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 8046 - 8046
Playground/babylon.d.txt


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 10099 - 10099
dist/preview release/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/babylon.js


+ 8 - 6
dist/preview release/babylon.max.js

@@ -19372,7 +19372,7 @@ var BABYLON;
             vectors[7].copyFromFloats(maxX, minY, maxZ);
             // OBB
             max.addToRef(min, this.center).scaleInPlace(0.5);
-            max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
+            max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
             this._update(worldMatrix || this._worldMatrix || BABYLON.Matrix.Identity());
         };
         /**
@@ -26922,6 +26922,7 @@ var BABYLON;
                         checkPicking = act.hasPickTriggers;
                     }
                 }
+                var eventRaised = false;
                 if (checkPicking) {
                     var btn = evt.button;
                     clickInfo.hasSwiped = _this._isPointerSwiping();
@@ -26942,6 +26943,7 @@ var BABYLON;
                             if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay ||
                                 btn !== _this._previousButtonPressed) {
                                 clickInfo.singleClick = true;
+                                eventRaised = true;
                                 cb(clickInfo, _this._currentPickResult);
                             }
                         }
@@ -27007,7 +27009,7 @@ var BABYLON;
                         }
                     }
                 }
-                else {
+                if (!eventRaised) {
                     clickInfo.ignore = true;
                     cb(clickInfo, _this._currentPickResult);
                 }
@@ -61859,10 +61861,10 @@ var BABYLON;
                 if (!this.isReady()) {
                     return;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio());
             // Determine the number of particles we need to create
@@ -67582,10 +67584,10 @@ var BABYLON;
                     }
                     this._preWarmDone = true;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return 0;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             // Get everything ready to render
             this._initialize();

+ 8 - 6
dist/preview release/babylon.no-module.max.js

@@ -19339,7 +19339,7 @@ var BABYLON;
             vectors[7].copyFromFloats(maxX, minY, maxZ);
             // OBB
             max.addToRef(min, this.center).scaleInPlace(0.5);
-            max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
+            max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
             this._update(worldMatrix || this._worldMatrix || BABYLON.Matrix.Identity());
         };
         /**
@@ -26889,6 +26889,7 @@ var BABYLON;
                         checkPicking = act.hasPickTriggers;
                     }
                 }
+                var eventRaised = false;
                 if (checkPicking) {
                     var btn = evt.button;
                     clickInfo.hasSwiped = _this._isPointerSwiping();
@@ -26909,6 +26910,7 @@ var BABYLON;
                             if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay ||
                                 btn !== _this._previousButtonPressed) {
                                 clickInfo.singleClick = true;
+                                eventRaised = true;
                                 cb(clickInfo, _this._currentPickResult);
                             }
                         }
@@ -26974,7 +26976,7 @@ var BABYLON;
                         }
                     }
                 }
-                else {
+                if (!eventRaised) {
                     clickInfo.ignore = true;
                     cb(clickInfo, _this._currentPickResult);
                 }
@@ -61826,10 +61828,10 @@ var BABYLON;
                 if (!this.isReady()) {
                     return;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio());
             // Determine the number of particles we need to create
@@ -67549,10 +67551,10 @@ var BABYLON;
                     }
                     this._preWarmDone = true;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return 0;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             // Get everything ready to render
             this._initialize();

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/babylon.worker.js


+ 8 - 6
dist/preview release/es6.js

@@ -19339,7 +19339,7 @@ var BABYLON;
             vectors[7].copyFromFloats(maxX, minY, maxZ);
             // OBB
             max.addToRef(min, this.center).scaleInPlace(0.5);
-            max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
+            max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
             this._update(worldMatrix || this._worldMatrix || BABYLON.Matrix.Identity());
         };
         /**
@@ -26889,6 +26889,7 @@ var BABYLON;
                         checkPicking = act.hasPickTriggers;
                     }
                 }
+                var eventRaised = false;
                 if (checkPicking) {
                     var btn = evt.button;
                     clickInfo.hasSwiped = _this._isPointerSwiping();
@@ -26909,6 +26910,7 @@ var BABYLON;
                             if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay ||
                                 btn !== _this._previousButtonPressed) {
                                 clickInfo.singleClick = true;
+                                eventRaised = true;
                                 cb(clickInfo, _this._currentPickResult);
                             }
                         }
@@ -26974,7 +26976,7 @@ var BABYLON;
                         }
                     }
                 }
-                else {
+                if (!eventRaised) {
                     clickInfo.ignore = true;
                     cb(clickInfo, _this._currentPickResult);
                 }
@@ -61826,10 +61828,10 @@ var BABYLON;
                 if (!this.isReady()) {
                     return;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio());
             // Determine the number of particles we need to create
@@ -67549,10 +67551,10 @@ var BABYLON;
                     }
                     this._preWarmDone = true;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return 0;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             // Get everything ready to render
             this._initialize();

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

@@ -674,6 +674,208 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * BABYLON.Animation play mode enum - is the animation looping or playing once
+        */
+    export const enum AnimationPlayMode {
+            ONCE = 0,
+            LOOP = 1
+    }
+    /**
+        * An enum representing the current state of an animation object
+        */
+    export const enum AnimationState {
+            INIT = 0,
+            PLAYING = 1,
+            PAUSED = 2,
+            STOPPED = 3,
+            ENDED = 4
+    }
+    /**
+        * The different type of easing functions available
+        */
+    export const enum EasingFunction {
+            Linear = 0,
+            CircleEase = 1,
+            BackEase = 2,
+            BounceEase = 3,
+            CubicEase = 4,
+            ElasticEase = 5,
+            ExponentialEase = 6,
+            PowerEase = 7,
+            QuadraticEase = 8,
+            QuarticEase = 9,
+            QuinticEase = 10,
+            SineEase = 11
+    }
+    /**
+        * Defines a simple animation to be applied to a model (scale).
+        */
+    export interface ModelAnimationConfiguration {
+            /**
+                * Time of animation, in seconds
+                */
+            time: number;
+            /**
+                * Scale to apply
+                */
+            scaling?: BABYLON.Vector3;
+            /**
+                * Easing function to apply
+                * See SPECTRE.EasingFunction
+                */
+            easingFunction?: number;
+            /**
+                * An Easing mode to apply to the easing function
+                * See BABYLON.EasingFunction
+                */
+            easingMode?: number;
+    }
+    /**
+        * This interface can be implemented to define new types of ModelAnimation objects.
+        */
+    export interface IModelAnimation {
+            /**
+                * Current animation state (playing, stopped etc')
+                */
+            readonly state: AnimationState;
+            /**
+                * the name of the animation
+                */
+            readonly name: string;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * BABYLON.Animation's FPS value
+                */
+            readonly fps: number;
+            /**
+                * Get or set the animation's speed ration (Frame-to-fps)
+                */
+            speedRatio: number;
+            /**
+                * Gets or sets the aimation's play mode.
+                */
+            playMode: AnimationPlayMode;
+            /**
+                * Start the animation
+                */
+            start(): any;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): any;
+            /**
+                * Pause the animation
+                * This will fail silently if the animation is not currently playing
+                */
+            pause(): any;
+            /**
+                * Reset this animation
+                */
+            reset(): any;
+            /**
+                * Restart the animation
+                */
+            restart(): any;
+            /**
+                * Go to a specific
+                * @param frameNumber the frame number to go to
+                */
+            goToFrame(frameNumber: number): any;
+            /**
+                * Dispose this animation
+                */
+            dispose(): any;
+    }
+    /**
+        * The GroupModelAnimation is an implementation of the IModelAnimation interface using BABYLON's
+        * native GroupAnimation class.
+        */
+    export class GroupModelAnimation implements IModelAnimation {
+            /**
+                * Create a new GroupModelAnimation object using an BABYLON.AnimationGroup object
+                * @param _animationGroup The aniamtion group to base the class on
+                */
+            constructor(_animationGroup: BABYLON.AnimationGroup);
+            /**
+                * Get the animation's name
+                */
+            readonly name: string;
+            /**
+                * Get the current animation's state
+                */
+            readonly state: AnimationState;
+            /**
+             * Sets the speed ratio to use for all animations
+             */
+            speedRatio: number;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * Get the FPS value of this animation
+                */
+            readonly fps: number;
+            /**
+             * Set the play mode.
+             * If the animation is played, it will continue playing at least once more, depending on the new play mode set.
+             * If the animation is not set, the will be initialized and will wait for the user to start playing it.
+             */
+            playMode: AnimationPlayMode;
+            /**
+                * Reset the animation group
+                */
+            reset(): void;
+            /**
+                * Restart the animation group
+                */
+            restart(): void;
+            /**
+                *
+                * @param frameNumber Go to a specific frame in the animation
+                */
+            goToFrame(frameNumber: number): void;
+            /**
+                * Start playing the animation.
+                */
+            start(): void;
+            /**
+                * Pause the animation
+                */
+            pause(): void;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): void;
+            /**
+                * Dispose this animation object.
+                */
+            dispose(): void;
+    }
 }
 declare module BabylonViewer {
     /**

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -732,7 +732,209 @@ declare module 'babylonjs-viewer/model/viewerModel' {
 }
 
 declare module 'babylonjs-viewer/model/modelAnimation' {
-    
+    import { AnimationGroup, Vector3 } from 'babylonjs';
+    /**
+        * Animation play mode enum - is the animation looping or playing once
+        */
+    export const enum AnimationPlayMode {
+            ONCE = 0,
+            LOOP = 1
+    }
+    /**
+        * An enum representing the current state of an animation object
+        */
+    export const enum AnimationState {
+            INIT = 0,
+            PLAYING = 1,
+            PAUSED = 2,
+            STOPPED = 3,
+            ENDED = 4
+    }
+    /**
+        * The different type of easing functions available
+        */
+    export const enum EasingFunction {
+            Linear = 0,
+            CircleEase = 1,
+            BackEase = 2,
+            BounceEase = 3,
+            CubicEase = 4,
+            ElasticEase = 5,
+            ExponentialEase = 6,
+            PowerEase = 7,
+            QuadraticEase = 8,
+            QuarticEase = 9,
+            QuinticEase = 10,
+            SineEase = 11
+    }
+    /**
+        * Defines a simple animation to be applied to a model (scale).
+        */
+    export interface ModelAnimationConfiguration {
+            /**
+                * Time of animation, in seconds
+                */
+            time: number;
+            /**
+                * Scale to apply
+                */
+            scaling?: Vector3;
+            /**
+                * Easing function to apply
+                * See SPECTRE.EasingFunction
+                */
+            easingFunction?: number;
+            /**
+                * An Easing mode to apply to the easing function
+                * See BABYLON.EasingFunction
+                */
+            easingMode?: number;
+    }
+    /**
+        * This interface can be implemented to define new types of ModelAnimation objects.
+        */
+    export interface IModelAnimation {
+            /**
+                * Current animation state (playing, stopped etc')
+                */
+            readonly state: AnimationState;
+            /**
+                * the name of the animation
+                */
+            readonly name: string;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * Animation's FPS value
+                */
+            readonly fps: number;
+            /**
+                * Get or set the animation's speed ration (Frame-to-fps)
+                */
+            speedRatio: number;
+            /**
+                * Gets or sets the aimation's play mode.
+                */
+            playMode: AnimationPlayMode;
+            /**
+                * Start the animation
+                */
+            start(): any;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): any;
+            /**
+                * Pause the animation
+                * This will fail silently if the animation is not currently playing
+                */
+            pause(): any;
+            /**
+                * Reset this animation
+                */
+            reset(): any;
+            /**
+                * Restart the animation
+                */
+            restart(): any;
+            /**
+                * Go to a specific
+                * @param frameNumber the frame number to go to
+                */
+            goToFrame(frameNumber: number): any;
+            /**
+                * Dispose this animation
+                */
+            dispose(): any;
+    }
+    /**
+        * The GroupModelAnimation is an implementation of the IModelAnimation interface using BABYLON's
+        * native GroupAnimation class.
+        */
+    export class GroupModelAnimation implements IModelAnimation {
+            /**
+                * Create a new GroupModelAnimation object using an AnimationGroup object
+                * @param _animationGroup The aniamtion group to base the class on
+                */
+            constructor(_animationGroup: AnimationGroup);
+            /**
+                * Get the animation's name
+                */
+            readonly name: string;
+            /**
+                * Get the current animation's state
+                */
+            readonly state: AnimationState;
+            /**
+             * Sets the speed ratio to use for all animations
+             */
+            speedRatio: number;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * Get the FPS value of this animation
+                */
+            readonly fps: number;
+            /**
+             * Set the play mode.
+             * If the animation is played, it will continue playing at least once more, depending on the new play mode set.
+             * If the animation is not set, the will be initialized and will wait for the user to start playing it.
+             */
+            playMode: AnimationPlayMode;
+            /**
+                * Reset the animation group
+                */
+            reset(): void;
+            /**
+                * Restart the animation group
+                */
+            restart(): void;
+            /**
+                *
+                * @param frameNumber Go to a specific frame in the animation
+                */
+            goToFrame(frameNumber: number): void;
+            /**
+                * Start playing the animation.
+                */
+            start(): void;
+            /**
+                * Pause the animation
+                */
+            pause(): void;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): void;
+            /**
+                * Dispose this animation object.
+                */
+            dispose(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/loader/plugins/loaderPlugin' {

+ 1 - 1
src/Culling/babylon.boundingBox.ts

@@ -91,7 +91,7 @@
 
             // OBB
             max.addToRef(min, this.center).scaleInPlace(0.5);
-            max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
+            max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
 
             this._update(worldMatrix || this._worldMatrix || Matrix.Identity());
         }

+ 5 - 2
src/babylon.scene.ts

@@ -1874,6 +1874,7 @@ module BABYLON {
                         checkPicking = act.hasPickTriggers;
                     }
                 }
+                let eventRaised = false;
                 if (checkPicking) {
                     let btn = evt.button;
                     clickInfo.hasSwiped = this._isPointerSwiping();
@@ -1898,7 +1899,7 @@ module BABYLON {
                             if (Date.now() - this._previousStartingPointerTime > Scene.DoubleClickDelay ||
                                 btn !== this._previousButtonPressed) {
                                 clickInfo.singleClick = true;
-
+                                eventRaised = true;
                                 cb(clickInfo, this._currentPickResult);
                             }
                         }
@@ -1966,7 +1967,9 @@ module BABYLON {
                             }
                         }
                     }
-                } else {
+                }
+
+                if (!eventRaised) {
                     clickInfo.ignore = true;
                     cb(clickInfo, this._currentPickResult);
                 }