Skip to content

Commit 1b4af32

Browse files
committed
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.
1 parent daa6fc6 commit 1b4af32

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/math/Quaternion.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ var tmpMat3 = new Matrix3();
3232
* @constructor
3333
* @since 3.0.0
3434
*
35-
* @param {number} [x] - The x component.
36-
* @param {number} [y] - The y component.
37-
* @param {number} [z] - The z component.
38-
* @param {number} [w] - The w component.
35+
* @param {number} [x=0] - The x component.
36+
* @param {number} [y=0] - The y component.
37+
* @param {number} [z=0] - The z component.
38+
* @param {number} [w=1] - The w component.
3939
*/
4040
var Quaternion = new Class({
4141

@@ -84,14 +84,14 @@ var Quaternion = new Class({
8484
this.x = x.x || 0;
8585
this.y = x.y || 0;
8686
this.z = x.z || 0;
87-
this.w = x.w || 0;
87+
this.w = x.w || 1;
8888
}
8989
else
9090
{
9191
this.x = x || 0;
9292
this.y = y || 0;
9393
this.z = z || 0;
94-
this.w = w || 0;
94+
this.w = w || 1;
9595
}
9696
},
9797

0 commit comments

Comments
 (0)