MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / GetEulerAngles

Method GetEulerAngles

TSMatrix3D.cpp:100–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100void Matrix3D::GetEulerAngles(float *x, float *y, float *z) const
101{
102 float sy = m02;
103 if (sy < 1.0F)
104 {
105 if (sy > -1.0F)
106 {
107 *x = -Arctan(m12, m22);
108 *y = Arcsin(sy);
109 *z = -Arctan(m01, m00);
110 }
111 else
112 {
113 *x = 0.0F;
114 *y = -Math::tau_over_4;
115 *z = Arctan(m10, m11);
116 }
117 }
118 else
119 {
120 *x = 0.0F;
121 *y = Math::tau_over_4;
122 *z = Arctan(m10, m11);
123 }
124}
125
126Matrix3D& Matrix3D::SetEulerAngles(float x, float y, float z)
127{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected