From 1b4af32ec253f718eb7f9660bd0461a870d28537 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Mon, 21 Sep 2020 10:13:50 +0100 Subject: [PATCH] The `Quaternion` class constructor will now default the values to `0,0,0,1` if they're not provided, making it an identity quaternion, rather than the `0,0,0,0` it was before. --- src/math/Quaternion.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/math/Quaternion.js b/src/math/Quaternion.js index c1d33199e..e6ea20ce1 100644 --- a/src/math/Quaternion.js +++ b/src/math/Quaternion.js @@ -32,10 +32,10 @@ var tmpMat3 = new Matrix3(); * @constructor * @since 3.0.0 * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. */ var Quaternion = new Class({ @@ -84,14 +84,14 @@ var Quaternion = new Class({ this.x = x.x || 0; this.y = x.y || 0; this.z = x.z || 0; - this.w = x.w || 0; + this.w = x.w || 1; } else { this.x = x || 0; this.y = y || 0; this.z = z || 0; - this.w = w || 0; + this.w = w || 1; } },