@babylonjs/core 7.13.2 → 7.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cameras/arcRotateCamera.d.ts +5 -0
- package/Cameras/arcRotateCamera.js +45 -0
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +5 -0
- package/Cameras/camera.js +7 -0
- package/Cameras/camera.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Maths/math.vector.d.ts +9 -0
- package/Maths/math.vector.js +14 -3
- package/Maths/math.vector.js.map +1 -1
- package/package.json +1 -1
package/Maths/math.vector.d.ts
CHANGED
|
@@ -600,6 +600,15 @@ export declare class Vector2 implements Vector<Tuple<number, 2>, IVector2Like>,
|
|
|
600
600
|
* @returns a new Vector2
|
|
601
601
|
*/
|
|
602
602
|
static Lerp(start: DeepImmutable<IVector2Like>, end: DeepImmutable<IVector2Like>, amount: number): Vector2;
|
|
603
|
+
/**
|
|
604
|
+
* Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
|
|
605
|
+
* @param start defines the start value
|
|
606
|
+
* @param end defines the end value
|
|
607
|
+
* @param amount max defines amount between both (between 0 and 1)
|
|
608
|
+
* @param result defines the Vector2 where to store the result
|
|
609
|
+
* @returns result input
|
|
610
|
+
*/
|
|
611
|
+
static LerpToRef(start: DeepImmutable<IVector2Like>, end: DeepImmutable<IVector2Like>, amount: number, result: Vector2): Vector2;
|
|
603
612
|
/**
|
|
604
613
|
* Gets the dot product of the vector "left" and the vector "right"
|
|
605
614
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#90
|
package/Maths/math.vector.js
CHANGED
|
@@ -759,9 +759,20 @@ export class Vector2 {
|
|
|
759
759
|
* @returns a new Vector2
|
|
760
760
|
*/
|
|
761
761
|
static Lerp(start, end, amount) {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
762
|
+
return Vector2.LerpToRef(start, end, amount, new Vector2());
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
|
|
766
|
+
* @param start defines the start value
|
|
767
|
+
* @param end defines the end value
|
|
768
|
+
* @param amount max defines amount between both (between 0 and 1)
|
|
769
|
+
* @param result defines the Vector2 where to store the result
|
|
770
|
+
* @returns result input
|
|
771
|
+
*/
|
|
772
|
+
static LerpToRef(start, end, amount, result) {
|
|
773
|
+
result.x = start.x + (end.x - start.x) * amount;
|
|
774
|
+
result.y = start.y + (end.y - start.y) * amount;
|
|
775
|
+
return result;
|
|
765
776
|
}
|
|
766
777
|
/**
|
|
767
778
|
* Gets the dot product of the vector "left" and the vector "right"
|