Skip to content

Commit 8a7801c

Browse files
committed
Revert Matrix44's CreateFromYawPitchRoll method to use the approach previously taken.
1 parent ff525ce commit 8a7801c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

source/abacus/gen/main/Matrix44.t4

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,9 @@
473473

474474
// Angle of rotation, in radians. Angles are measured anti-clockwise when viewed from the rotation axis (positive side) toward the origin.
475475
<#Inl();#>public static void CreateFromYawPitchRoll (ref <#=T#> yaw, ref <#=T#> pitch, ref <#=T#> roll, out Matrix44 r) {
476-
<#=T#> cy = Maths.Cos (yaw), sy = Maths.Sin (yaw);
477-
<#=T#> cx = Maths.Cos (pitch), sx = Maths.Sin (pitch);
478-
<#=T#> cz = Maths.Cos (roll), sz = Maths.Sin (roll);
479-
r.R0C0 = cz*cy+sz*sx*sy; r.R0C1 = sz*cx; r.R0C2 = -cz*sy+sz*sx*cy; r.R0C3 = 0;
480-
r.R1C0 = -sz*cy+cz*sx*sy; r.R1C1 = cz*cx; r.R1C2 = -cz*sy+sz*sx*cy; r.R1C3 = 0;
481-
r.R2C0 = cx*sy; r.R2C1 = -sx; r.R2C2 = cx*cy; r.R2C3 = 0;
482-
r.R3C0 = 0; r.R3C1 = 0; r.R3C2 = 0; r.R3C3 = 1;
476+
Quaternion quaternion;
477+
Quaternion.CreateFromYawPitchRoll(ref yaw, ref pitch, ref roll, out quaternion);
478+
CreateFromQuaternion(ref quaternion, out r);
483479
}
484480

485481
// http://msdn.microsoft.com/en-us/library/bb205351(v=vs.85).aspx

0 commit comments

Comments
 (0)