1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 02:44:54 +00:00

rename Matrix_TranslateThenRotateZYX to Matrix_RotateRPYf (#96)

* rename Matrix_TranslateThenRotateZYX to Matrix_RotateRPYf

* rename Matrix_RotateRPYf to Matrix_JointPosition

* rename Matrix_RotateZYX to Matrix_RotateRPY
This commit is contained in:
krimtonz 2020-04-27 23:14:27 -05:00 committed by GitHub
parent d58983494c
commit 58e38276c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 135 additions and 132 deletions

View file

@ -301,7 +301,7 @@ void Matrix_RotateZ(f32 z, u8 mode) {
* by `x` degrees. (roll-pitch-yaw)
* Original Name: Matrix_RotateXYZ, changed to reflect rotation order.
*/
void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode) {
void Matrix_RotateRPY(s16 x, s16 y, s16 z, u8 mode) {
MtxF* cmf = sCurrentMatrix;
f32 temp1;
f32 temp2;
@ -387,10 +387,9 @@ void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode) {
}
/*
* Translates the top of the matrix stack by `translation` units,
* then rotates that matrix by `rotation` in Z-Y-X order (roll-pitch-yaw)
* Roll-pitch-yaw rotation and position
*/
void Matrix_TranslateThenRotateZYX(Vec3f* translation, Vec3s* rotation) {
void Matrix_JointPosition(Vec3f* position, Vec3s* rotation) {
MtxF* cmf = sCurrentMatrix;
f32 sin;
f32 cos;
@ -402,25 +401,25 @@ void Matrix_TranslateThenRotateZYX(Vec3f* translation, Vec3s* rotation) {
temp1 = cmf->xx;
temp2 = cmf->yx;
cmf->wx += temp1 * translation->x + temp2 * translation->y + cmf->zx * translation->z;
cmf->wx += temp1 * position->x + temp2 * position->y + cmf->zx * position->z;
cmf->xx = temp1 * cos + temp2 * sin;
cmf->yx = temp2 * cos - temp1 * sin;
temp1 = cmf->xy;
temp2 = cmf->yy;
cmf->wy += temp1 * translation->x + temp2 * translation->y + cmf->zy * translation->z;
cmf->wy += temp1 * position->x + temp2 * position->y + cmf->zy * position->z;
cmf->xy = temp1 * cos + temp2 * sin;
cmf->yy = temp2 * cos - temp1 * sin;
temp1 = cmf->xz;
temp2 = cmf->yz;
cmf->wz += temp1 * translation->x + temp2 * translation->y + cmf->zz * translation->z;
cmf->wz += temp1 * position->x + temp2 * position->y + cmf->zz * position->z;
cmf->xz = temp1 * cos + temp2 * sin;
cmf->yz = temp2 * cos - temp1 * sin;
temp1 = cmf->xw;
temp2 = cmf->yw;
cmf->ww += temp1 * translation->x + temp2 * translation->y + cmf->zw * translation->z;
cmf->ww += temp1 * position->x + temp2 * position->y + cmf->zw * position->z;
cmf->xw = temp1 * cos + temp2 * sin;
cmf->yw = temp2 * cos - temp1 * sin;