David Catuhe 6 rokov pred
rodič
commit
5fe2b6de03

+ 2 - 2
src/Animations/animatable.ts

@@ -20,7 +20,7 @@ export class Animatable {
     private _scene: Scene;
     private _scene: Scene;
     private _speedRatio = 1;
     private _speedRatio = 1;
     private _weight = -1.0;
     private _weight = -1.0;
-    private _syncRoot: Animatable;
+    private _syncRoot: Nullable<Animatable> = null;
 
 
     /**
     /**
      * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.
      * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.
@@ -46,7 +46,7 @@ export class Animatable {
     /**
     /**
      * Gets the root Animatable used to synchronize and normalize animations
      * Gets the root Animatable used to synchronize and normalize animations
      */
      */
-    public get syncRoot(): Animatable {
+    public get syncRoot(): Nullable<Animatable> {
         return this._syncRoot;
         return this._syncRoot;
     }
     }
 
 

+ 3 - 1
src/Culling/boundingBox.ts

@@ -98,8 +98,10 @@ export class BoundingBox implements ICullable {
         // OBB
         // OBB
         max.addToRef(min, this.center).scaleInPlace(0.5);
         max.addToRef(min, this.center).scaleInPlace(0.5);
         max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
         max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
+        
+        this._worldMatrix = worldMatrix || Matrix.IdentityReadOnly;
 
 
-        this._update(worldMatrix || Matrix.IdentityReadOnly);
+        this._update(this._worldMatrix);
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/Maths/math.ts

@@ -4386,7 +4386,7 @@ export class Matrix {
      * It will be incremented every time the matrix data change.
      * It will be incremented every time the matrix data change.
      * You can use it to speed the comparison between two versions of the same matrix.
      * You can use it to speed the comparison between two versions of the same matrix.
      */
      */
-    public updateFlag: number;
+    public updateFlag: number = -1;
 
 
     private readonly _m: Float32Array = new Float32Array(16);
     private readonly _m: Float32Array = new Float32Array(16);