|
@@ -5416,15 +5416,29 @@ var BABYLON;
|
|
|
Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 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
|
|
|
+ * @returns the new matrix
|
|
|
*/
|
|
|
Matrix.Lerp = function (startValue, endValue, gradient) {
|
|
|
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
|
|
|
+ */
|
|
|
+ Matrix.LerpToRef = function (startValue, endValue, gradient, result) {
|
|
|
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 :
|
|
@@ -56404,6 +56418,9 @@ var BABYLON;
|
|
|
};
|
|
|
};
|
|
|
DracoCompression._GetDefaultDecoderUrl = function () {
|
|
|
+ if (!BABYLON.Tools.IsWindowObjectExist) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
for (var i = 0; i < document.scripts.length; i++) {
|
|
|
if (document.scripts[i].type === "text/x-draco-decoder") {
|
|
|
return document.scripts[i].src;
|
|
@@ -77991,9 +78008,12 @@ var BABYLON;
|
|
|
for (y = y_start; y !== y_end; y += y_step) {
|
|
|
for (x = x_start; x !== x_end; x += x_step, i += 2) {
|
|
|
color = image[i + 0] + (image[i + 1] << 8); // Inversed ?
|
|
|
- imageData[(x + width * y) * 4 + 0] = (color & 0x7C00) >> 7;
|
|
|
- imageData[(x + width * y) * 4 + 1] = (color & 0x03E0) >> 2;
|
|
|
- imageData[(x + width * y) * 4 + 2] = (color & 0x001F) >> 3;
|
|
|
+ var r = (((color & 0x7C00) >> 10) * 255) / 0x1F | 0;
|
|
|
+ var g = (((color & 0x03E0) >> 5) * 255) / 0x1F | 0;
|
|
|
+ var b = ((color & 0x001F) * 255) / 0x1F | 0;
|
|
|
+ imageData[(x + width * y) * 4 + 0] = r;
|
|
|
+ imageData[(x + width * y) * 4 + 1] = g;
|
|
|
+ imageData[(x + width * y) * 4 + 2] = b;
|
|
|
imageData[(x + width * y) * 4 + 3] = (color & 0x8000) ? 0 : 255;
|
|
|
}
|
|
|
}
|