| 163 | } |
| 164 | |
| 165 | void 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 | |
| 196 | void xMat4x3MoveLocalRight(xMat4x3* m, F32 mag) |
| 197 | { |
no test coverage detected