|
@@ -4369,17 +4369,34 @@
|
|
|
0.0, 0.0, 1.0, 0.0,
|
|
|
x, y, z, 1.0, result);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- * Returns a new Matrix whose values are the interpolated values for "gradien" (float) between the ones of the matrices "startValue" and "endValue".
|
|
|
+ * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
|
|
|
+ * @param startValue defines the start value
|
|
|
+ * @param endValue defines the end value
|
|
|
+ * @param gradient defines the gradient factor
|
|
|
*/
|
|
|
public static Lerp(startValue: Matrix, endValue: Matrix, gradient: number): Matrix {
|
|
|
var result = Matrix.Zero();
|
|
|
+ Matrix.LerpToRef(startValue, endValue, gradient, result);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the passed matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
|
|
|
+ * @param startValue defines the start value
|
|
|
+ * @param endValue defines the end value
|
|
|
+ * @param gradient defines the gradient factor
|
|
|
+ * @param result defines the Matrix object where to store data
|
|
|
+ */
|
|
|
+ public static LerpToRef(startValue: Matrix, endValue: Matrix, gradient: number, result: Matrix): Matrix {
|
|
|
+ var result = Matrix.Zero();
|
|
|
for (var index = 0; index < 16; index++) {
|
|
|
result.m[index] = startValue.m[index] * (1.0 - gradient) + endValue.m[index] * gradient;
|
|
|
}
|
|
|
result._markAsUpdated();
|
|
|
return result;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Returns a new Matrix whose values are computed by :
|