|
@@ -3612,5 +3612,18 @@
|
|
return new PositionNormalTextureVertex(this.position.clone(), this.normal.clone(), this.uv.clone());
|
|
return new PositionNormalTextureVertex(this.position.clone(), this.normal.clone(), this.uv.clone());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
|
|
|
|
+ // Temporary pre-allocated objects for engine internal use
|
|
|
|
+ // usage in any internal function :
|
|
|
|
+ // var tmp = Tmp.Vector3[0]; <= gets access to the first pre-created Vector3
|
|
|
|
+ // There's a Tmp array per object type : int, float, Vector2, Vector3, Vector4, Quaternion, Matrix
|
|
|
|
+ export class Tmp {
|
|
|
|
+ public static Int: number[] = [ 0, 0, 0, 0, 0, 0 ]; // 6 temp integers at once should be enough
|
|
|
|
+ public static Float: number[] = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; // 6 temp floats at once should be enough
|
|
|
|
+ public static Vector2: Vector2[] = [ Vector2.Zero(), Vector2.Zero(), Vector2.Zero() ]; // 3 temp Vector2 at once should be enough
|
|
|
|
+ public static Vector3: Vector3[] = [ Vector3.Zero(), Vector3.Zero(), Vector3.Zero() ]; // 3 temp Vector3 at once should be enough
|
|
|
|
+ public static Vector4: Vector4[] = [ Vector4.Zero(), Vector4.Zero(), Vector4.Zero() ]; // 3 temp Vector4 at once should be enough
|
|
|
|
+ public static Quaternion: Quaternion[] = [ new Quaternion(0, 0, 0, 0) ]; // 1 temp Quaternion at once should be enough
|
|
|
|
+ public static Matrix: Matrix[] = [ Matrix.Zero() ]; // 1 temp Matrix at once should be enough
|
|
|
|
+ }
|
|
|
|
+}
|