MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xMat3x3GetEuler

Function xMat3x3GetEuler

src/SB/Core/x/xMath3.cpp:165–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void xMat3x3GetEuler(const xMat3x3* m, xVec3* a)
166{
167 F32 yaw = -xasin(m->at.y);
168
169 F32 roll;
170 F32 pitch;
171
172 if (yaw < (PI / 2))
173 {
174 if (yaw > -(PI / 2))
175 {
176 pitch = xatan2(m->at.x, m->at.z);
177 roll = xatan2(m->right.y, m->up.y);
178 }
179 else
180 {
181 pitch = -xatan2(-m->up.x, m->right.x);
182 roll = 0.0f;
183 }
184 }
185 else
186 {
187 pitch = xatan2(-m->up.x, m->right.x);
188 roll = 0.0f;
189 }
190
191 a->x = pitch;
192 a->y = yaw;
193 a->z = roll;
194}
195
196void xMat4x3MoveLocalRight(xMat4x3* m, F32 mag)
197{

Callers 15

xEntDriveMountFunction · 0.70
xEntDriveUpdateFunction · 0.70
_xCameraUpdateFunction · 0.70
xCameraFXShakeUpdateFunction · 0.70
xCameraRotateFunction · 0.70
PlayerAbsControlFunction · 0.50
startMethod · 0.50
moveMethod · 0.50
startMethod · 0.50
zEntHangable_UpdateFunction · 0.50
zEntHangable_SetMatrixFunction · 0.50

Calls 2

xasinFunction · 0.85
xatan2Function · 0.85

Tested by

no test coverage detected