Skip to content

Commit fdde74a

Browse files
committed
Prefer linear assignment order in Matrix4.compose
1 parent c11662b commit fdde74a

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

src/math/Matrix4.js

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -740,30 +740,27 @@ Object.assign( Matrix4.prototype, {
740740

741741
var sx = scale.x, sy = scale.y, sz = scale.z;
742742

743-
te[ 0 ] = ( 1 - ( yy + zz ) ) * sx;
744-
te[ 4 ] = ( xy - wz ) * sy;
745-
te[ 8 ] = ( xz + wy ) * sz;
746-
747-
te[ 1 ] = ( xy + wz ) * sx;
748-
te[ 5 ] = ( 1 - ( xx + zz ) ) * sy;
749-
te[ 9 ] = ( yz - wx ) * sz;
750-
751-
te[ 2 ] = ( xz - wy ) * sx;
752-
te[ 6 ] = ( yz + wx ) * sy;
753-
te[ 10 ] = ( 1 - ( xx + yy ) ) * sz;
754-
755-
// bottom row
756-
te[ 3 ] = 0;
757-
te[ 7 ] = 0;
758-
te[ 11 ] = 0;
759-
760-
// last column
761-
te[ 12 ] = position.x;
762-
te[ 13 ] = position.y;
763-
te[ 14 ] = position.z;
764-
te[ 15 ] = 1;
765-
766-
return this;
743+
te[ 0 ] = ( 1 - ( yy + zz ) ) * sx;
744+
te[ 1 ] = ( xy + wz ) * sx;
745+
te[ 2 ] = ( xz - wy ) * sx;
746+
te[ 3 ] = 0;
747+
748+
te[ 4 ] = ( xy - wz ) * sy;
749+
te[ 5 ] = ( 1 - ( xx + zz ) ) * sy;
750+
te[ 6 ] = ( yz + wx ) * sy;
751+
te[ 7 ] = 0;
752+
753+
te[ 8 ] = ( xz + wy ) * sz;
754+
te[ 9 ] = ( yz - wx ) * sz;
755+
te[ 10 ] = ( 1 - ( xx + yy ) ) * sz;
756+
te[ 11 ] = 0;
757+
758+
te[ 12 ] = position.x;
759+
te[ 13 ] = position.y;
760+
te[ 14 ] = position.z;
761+
te[ 15 ] = 1;
762+
763+
return this;
767764

768765
},
769766

0 commit comments

Comments
 (0)