mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-05 15:34:41 +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:
parent
d58983494c
commit
58e38276c6
65 changed files with 135 additions and 132 deletions
|
@ -134,10 +134,10 @@ void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput)
|
|||
void Audio_NoteInit(Note* note) {
|
||||
if (note->playbackState.parentLayer->adsr.releaseRate == 0) {
|
||||
Audio_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->seqChannel->adsr.envelope,
|
||||
¬e->playbackState.adsrVolScale);
|
||||
¬e->playbackState.adsrVolScale);
|
||||
} else {
|
||||
Audio_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->adsr.envelope,
|
||||
¬e->playbackState.adsrVolScale);
|
||||
¬e->playbackState.adsrVolScale);
|
||||
}
|
||||
|
||||
note->playbackState.unk_04 = 0;
|
||||
|
@ -576,8 +576,7 @@ Note* Audio_PopNodeWithValueLessEqual(AudioListItem* list, s32 limit) {
|
|||
}
|
||||
|
||||
for (best = cur; cur != list; cur = cur->next) {
|
||||
if (((Note*)best->u.value)->playbackState.priority >=
|
||||
((Note*)cur->u.value)->playbackState.priority) {
|
||||
if (((Note*)best->u.value)->playbackState.priority >= ((Note*)cur->u.value)->playbackState.priority) {
|
||||
best = cur;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -299,13 +299,13 @@ void func_8003E954(u32 uParm1, u8* puParm2) {
|
|||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041648.s")
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x10];
|
||||
/* 0x00 */ char unk_00[0x10];
|
||||
/* 0x10 */ void* unk_10;
|
||||
/* 0x14 */ char unk_[0x04];
|
||||
/* 0x14 */ char unk_[0x04];
|
||||
/* 0x18 */ void* unk_18;
|
||||
/* 0x1C */ void* unk_1C;
|
||||
/* 0x20 */ void* unk_20;
|
||||
/* 0x24 */ char unk_24[4];
|
||||
/* 0x24 */ char unk_24[4];
|
||||
/* 0x28 */ void* unk_28;
|
||||
} Struct800417A0; // size = 0x32
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalCont
|
|||
Matrix_Translate(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateRPY(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
|
||||
gDPLoadTextureBlock(gfxCtx->polyXlu.p++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
|
|
@ -50,7 +50,7 @@ void SkelAnime_LodDrawLimb(GlobalContext* globalCtx, s32 limbIndex, Skeleton* sk
|
|||
|
||||
dList = limbEntry->displayLists[dListIndex];
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
do {
|
||||
if (1) {
|
||||
|
@ -114,7 +114,7 @@ void SkelAnime_LodDraw(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* limb
|
|||
dList = limbEntry->displayLists[dListIndex];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD);
|
||||
|
||||
|
@ -163,7 +163,7 @@ void SkelAnime_LodDrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, Skeleton*
|
|||
dList[1] = dList[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList[1], &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList[1] != NULL) {
|
||||
Matrix_ToMtx(*mtx, "../z_skelanime.c", 945);
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
@ -233,7 +233,7 @@ void SkelAnime_LodDrawSV(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* li
|
|||
dList[1] = dList[0];
|
||||
|
||||
if ((overrideLimbDraw == 0) || (overrideLimbDraw(globalCtx, 1, &dList[1], &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList[1] != NULL) {
|
||||
Matrix_ToMtx(mtx, "../z_skelanime.c", 1033);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD);
|
||||
|
@ -284,7 +284,7 @@ void SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, Skeleton* skele
|
|||
dList = limbEntry->displayLists[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
do {
|
||||
if (1) {
|
||||
|
@ -346,7 +346,7 @@ void SkelAnime_Draw(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* limbDra
|
|||
dList = rootLimb->displayLists[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 1176),
|
||||
G_MTX_LOAD);
|
||||
|
@ -394,7 +394,7 @@ void SkelAnime_DrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, Skeleton* ske
|
|||
dList[1] = dList[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList[1], &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList[1] != NULL) {
|
||||
Matrix_ToMtx(*limbMatricies, "../z_skelanime.c", 1242);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, *limbMatricies, G_MTX_LOAD);
|
||||
|
@ -465,7 +465,7 @@ void SkelAnime_DrawSV(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* limbD
|
|||
dList[1] = dList[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, 1, &dList[1], &pos, &rot, actor) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList[1] != NULL) {
|
||||
Matrix_ToMtx(mtx, "../z_skelanime.c", 1327);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD);
|
||||
|
@ -563,7 +563,7 @@ Gfx* SkelAnime_Draw2Limb(GlobalContext* globalCtx, s32 limbIndex, Skeleton* skel
|
|||
dList = limbEntry->displayLists[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, actor, &gfx) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD);
|
||||
gSPDisplayList(gfx++, dList);
|
||||
|
@ -621,7 +621,7 @@ Gfx* SkelAnime_Draw2(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* limbDr
|
|||
dList = limbEntry->displayLists[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, actor, &gfx) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD);
|
||||
gSPDisplayList(gfx++, dList);
|
||||
|
@ -664,7 +664,7 @@ Gfx* SkelAnime_DrawLimbSV2(GlobalContext* globalCtx, s32 limbIndex, Skeleton* sk
|
|||
|
||||
dList1 = dList2 = limbEntry->displayLists[0];
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList1, &pos, &rot, actor, &gfx) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList1 != NULL) {
|
||||
Matrix_ToMtx(*mtx, "../z_skelanime.c", 1623);
|
||||
gSPMatrix(gfx++, *mtx, G_MTX_LOAD);
|
||||
|
@ -731,7 +731,7 @@ Gfx* SkelAnime_DrawSV2(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* limb
|
|||
dList1 = dList2 = limbEntry->displayLists[0];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, 1, &dList1, &pos, &rot, actor, &gfx) == 0)) {
|
||||
Matrix_TranslateThenRotateZYX(&pos, &rot);
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
if (dList1 != NULL) {
|
||||
Matrix_ToMtx(mtx, "../z_skelanime.c", 1710);
|
||||
gSPMatrix(gfx++, mtx, G_MTX_LOAD);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue