David Catuhe 6 年之前
父節點
當前提交
5fe2b6de03
共有 3 個文件被更改,包括 6 次插入4 次删除
  1. 2 2
      src/Animations/animatable.ts
  2. 3 1
      src/Culling/boundingBox.ts
  3. 1 1
      src/Maths/math.ts

+ 2 - 2
src/Animations/animatable.ts

@@ -20,7 +20,7 @@ export class Animatable {
     private _scene: Scene;
     private _speedRatio = 1;
     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.
@@ -46,7 +46,7 @@ export class Animatable {
     /**
      * Gets the root Animatable used to synchronize and normalize animations
      */
-    public get syncRoot(): Animatable {
+    public get syncRoot(): Nullable<Animatable> {
         return this._syncRoot;
     }
 

+ 3 - 1
src/Culling/boundingBox.ts

@@ -98,8 +98,10 @@ export class BoundingBox implements ICullable {
         // OBB
         max.addToRef(min, this.center).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.
      * 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);