mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-09 20:40:42 -04:00
sys_matrix OK, documented, rename some other mathematics functions (#787)
* Import data and bss, add some name options * Decomp rest of stack functions, remove RSPMatrix, split header * sys_matrix OK (thanks Tharo) Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * pragma weaks in sinf and cosf, change documentation change mcros to use 0x8000 * Rename sinf and cosf * Correct initialisation of sMtxFClear * More minor cleanup * Rename stack functions * Matrix_InsertMatrix -> Matrix_Mult * The big transpose rename * Fix MirRay_DrawReflectedBeam * Matrix_InsertTranslation -> Matrix_Translate * Matrix_Insert.Rotation_s -> Matrix_Rotate$1S + RotateY -> RotateYS * Matrix_Insert(.)Rotation_f -> Matrix_Rotate$1F * Matrix_RotateStateAroundXAxis -> Matrix_RotateXFApply Matrix_SetStateXRotation -> Matrix_RotateXFNew * Matrix_MultiplyVector3fByState -> Matrix_MultVec3f * Matrix_MultiplyVector3fXZByCurrentState -> Matrix_MultVec3fXZ * Matrix_GetStateTranslation -> Matrix_MultZero * Matrix_GetStateTranslationAndScaled(.) -> Matrix_MultVec$1 * Matrix_FromRSPMatrix -> Matrix_MtxToMtxF * Matrix_MultiplyVector3fByMatrix -> Matrix_MultVec3fExt * Matrix_TransposeXYZ -> Matrix_Transpose * Matrix_ToRSPMatrix -> Matrix_MtxFToMtx * Matrix_AppendToPolyOpaDisp -> Matrix_MtxFToNewMtx and document the conversion functions * Matrix_NormalizeXYZ -> Matrix_ReplaceRotation * Matrix_InsertRotationAroundUnitVector_f -> Matrix_RotateAxisF and S * Matrix_InsertRotation -> Matrix_RotateZYX * Document the last functions * Small cleanup * Matrix_JointPosition -> Matrix_TranslateRotateZYX * Matrix_SetStateRotationAndTranslation -> Matrix_SetTranslateRotateYXZ * func_8018219C -> Matrix_MtxFToYXZRot * func_801822C4 -> Matrix_MtxFToZYXRot * Fix files * Format * Review 1 * Renames * Fix warning in EnDragon * Format * Convert `mode` to an actual enum * Add enums, typedefs, externs to sys_matrix header * Review * One more * More review * Fix function names * Format * Fix names * Format * Review * engineer's review * Fix build * Format * Fix again Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
@@ -14,11 +14,11 @@ extern f32 func_80086D18(f32 x);
|
||||
s32 gUseAtanContFrac;
|
||||
|
||||
/**
|
||||
* Tangent function computed using libultra __sinf and __cosf
|
||||
* Tangent function computed using libultra sinf and cosf
|
||||
*/
|
||||
// Math_FTanF
|
||||
f32 func_80086760(f32 x) {
|
||||
return __sinf(x) / __cosf(x);
|
||||
return sinf(x) / cosf(x);
|
||||
}
|
||||
|
||||
// Unused
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
#include "global.h"
|
||||
|
||||
void MtxConv_F2L(MatrixInternal* m1, MtxF* m2) {
|
||||
void MtxConv_F2L(Mtx* mtx, MtxF* mf) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
s32 value = (m2->mf[i][j] * 0x10000);
|
||||
m1->intPart[i][j] = value >> 16;
|
||||
m1->fracPart[i][j] = value;
|
||||
s32 value = (mf->mf[i][j] * 0x10000);
|
||||
|
||||
mtx->intPart[i][j] = value >> 16;
|
||||
mtx->fracPart[i][j] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MtxConv_L2F(MtxF* m1, MatrixInternal* m2) {
|
||||
guMtxL2F(m1, (Mtx*)m2);
|
||||
void MtxConv_L2F(MtxF* mtx, Mtx* mf) {
|
||||
guMtxL2F(mtx, mf);
|
||||
}
|
||||
|
||||
+1895
-40
File diff suppressed because it is too large
Load Diff
+46
-47
@@ -92,10 +92,10 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gf
|
||||
}
|
||||
|
||||
func_800C0094(actor->floorPoly, actor->world.pos.x, actor->floorHeight, actor->world.pos.z, &mtx);
|
||||
Matrix_SetCurrentState(&mtx);
|
||||
Matrix_Put(&mtx);
|
||||
|
||||
if ((dlist != gCircleShadowDL) || (actor->scale.x != actor->scale.z)) {
|
||||
Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
shadowScale *= actor->shape.shadowScale;
|
||||
@@ -151,8 +151,8 @@ void ActorShadow_DrawFoot(GlobalContext* globalCtx, Light* light, MtxF* arg2, s3
|
||||
sp58 = Math_FAtan2F(dir2, dir0);
|
||||
shadowScaleZ *= (4.5f - (light->l.dir[1] * 0.035f));
|
||||
shadowScaleZ = CLAMP_MIN(shadowScaleZ, 1.0f);
|
||||
Matrix_SetCurrentState(arg2);
|
||||
Matrix_RotateY(sp58, MTXMODE_APPLY);
|
||||
Matrix_Put(arg2);
|
||||
Matrix_RotateYS(sp58, MTXMODE_APPLY);
|
||||
Matrix_Scale(shadowScaleX, 1.0f, shadowScaleX * shadowScaleZ, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
@@ -301,9 +301,9 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
||||
void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex,
|
||||
Vec3f* rightFootPos) {
|
||||
if (limbIndex == leftFootIndex) {
|
||||
Matrix_MultiplyVector3fByState(leftFootPos, &actor->shape.feetPos[FOOT_LEFT]);
|
||||
Matrix_MultVec3f(leftFootPos, &actor->shape.feetPos[FOOT_LEFT]);
|
||||
} else if (limbIndex == rightFootIndex) {
|
||||
Matrix_MultiplyVector3fByState(rightFootPos, &actor->shape.feetPos[FOOT_RIGHT]);
|
||||
Matrix_MultVec3f(rightFootPos, &actor->shape.feetPos[FOOT_RIGHT]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,22 +533,22 @@ void Actor_DrawZTarget(TargetContext* targetCtx, GlobalContext* globalCtx) {
|
||||
var2 = ((entry->unkC - 120.0f) * 0.001f) + 0.15f;
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(entry->pos.x, entry->pos.y, 0.0f, MTXMODE_NEW);
|
||||
Matrix_Translate(entry->pos.x, entry->pos.y, 0.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(var2, 0.15f, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, entry->color.r, entry->color.g, entry->color.b,
|
||||
(u8)alpha);
|
||||
|
||||
Matrix_InsertZRotation_s((targetCtx->unk4B * 512), MTXMODE_APPLY);
|
||||
Matrix_RotateZS((targetCtx->unk4B * 512), MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
Matrix_InsertZRotation_s(0x4000, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(entry->unkC, entry->unkC, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(0x4000, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
Matrix_Translate(entry->unkC, entry->unkC, 0.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(OVERLAY_DISP++, gZTargetLockOnTriangleDL);
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,10 +566,10 @@ void Actor_DrawZTarget(TargetContext* targetCtx, GlobalContext* globalCtx) {
|
||||
|
||||
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x07);
|
||||
|
||||
Matrix_InsertTranslation(actor->focus.pos.x,
|
||||
actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y) + 17.0f,
|
||||
actor->focus.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY((globalCtx->gameplayFrames * 3000), MTXMODE_APPLY);
|
||||
Matrix_Translate(actor->focus.pos.x,
|
||||
actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y) + 17.0f,
|
||||
actor->focus.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS((globalCtx->gameplayFrames * 3000), MTXMODE_APPLY);
|
||||
Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f,
|
||||
MTXMODE_APPLY);
|
||||
|
||||
@@ -2511,14 +2511,13 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) {
|
||||
Lights_Draw(light, globalCtx->state.gfxCtx);
|
||||
|
||||
if (actor->flags & ACTOR_FLAG_1000) {
|
||||
Matrix_SetStateRotationAndTranslation(
|
||||
Matrix_SetTranslateRotateYXZ(
|
||||
actor->world.pos.x + globalCtx->mainCamera.skyboxOffset.x,
|
||||
actor->world.pos.y + ((actor->shape.yOffset * actor->scale.y) + globalCtx->mainCamera.skyboxOffset.y),
|
||||
actor->world.pos.z + globalCtx->mainCamera.skyboxOffset.z, &actor->shape.rot);
|
||||
} else {
|
||||
Matrix_SetStateRotationAndTranslation(actor->world.pos.x,
|
||||
actor->world.pos.y + (actor->shape.yOffset * actor->scale.y),
|
||||
actor->world.pos.z, &actor->shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(actor->world.pos.x, actor->world.pos.y + (actor->shape.yOffset * actor->scale.y),
|
||||
actor->world.pos.z, &actor->shape.rot);
|
||||
}
|
||||
|
||||
Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY);
|
||||
@@ -3543,14 +3542,14 @@ void Actor_SpawnBodyParts(Actor* actor, GlobalContext* globalCtx, s32 arg2, Gfx*
|
||||
MtxF* currentMatrix;
|
||||
|
||||
if (*dList != NULL) {
|
||||
currentMatrix = Matrix_GetCurrentState();
|
||||
currentMatrix = Matrix_GetCurrent();
|
||||
spawnedPart =
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, actor, globalCtx, ACTOR_EN_PART, currentMatrix->mf[3][0],
|
||||
currentMatrix->mf[3][1], currentMatrix->mf[3][2], 0, 0, actor->objBankIndex, arg2);
|
||||
if (spawnedPart != NULL) {
|
||||
part = (EnPart*)spawnedPart;
|
||||
|
||||
func_8018219C(currentMatrix, &part->actor.shape.rot, 0);
|
||||
Matrix_MtxFToYXZRot(currentMatrix, &part->actor.shape.rot, false);
|
||||
part->unk_150 = *dList;
|
||||
Math_Vec3f_Copy(&part->actor.scale, &actor->scale);
|
||||
}
|
||||
@@ -3772,9 +3771,9 @@ void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx)
|
||||
sp54 = BgCheck_EntityRaycastFloor2(globalCtx, &globalCtx->colCtx, &sp44, &sp48);
|
||||
if (sp44 != NULL) {
|
||||
func_800C0094(sp44, arg0->x, sp54, arg0->z, &sp58);
|
||||
Matrix_SetCurrentState(&sp58);
|
||||
Matrix_Put(&sp58);
|
||||
} else {
|
||||
Matrix_InsertTranslation(arg0->x, arg0->y, arg0->z, MTXMODE_NEW);
|
||||
Matrix_Translate(arg0->x, arg0->y, arg0->z, MTXMODE_NEW);
|
||||
}
|
||||
Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY);
|
||||
|
||||
@@ -3841,16 +3840,16 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(0.0f, entry->yShift, 500.0f, MTXMODE_APPLY);
|
||||
Matrix_CopyCurrentState(&baseMtxF);
|
||||
Matrix_Translate(0.0f, entry->yShift, 500.0f, MTXMODE_APPLY);
|
||||
Matrix_Get(&baseMtxF);
|
||||
|
||||
chainsTranslateX = __sinf(entry->chainAngle - chainRotZ) * -(10 - frame) * 0.1f * entry->chainLength;
|
||||
chainsTranslateY = __cosf(entry->chainAngle - chainRotZ) * (10 - frame) * 0.1f * entry->chainLength;
|
||||
chainsTranslateX = sinf(entry->chainAngle - chainRotZ) * -(10 - frame) * 0.1f * entry->chainLength;
|
||||
chainsTranslateY = cosf(entry->chainAngle - chainRotZ) * (10 - frame) * 0.1f * entry->chainLength;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
Matrix_SetCurrentState(&baseMtxF);
|
||||
Matrix_InsertZRotation_f(chainRotZ, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(chainsTranslateX, chainsTranslateY, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Put(&baseMtxF);
|
||||
Matrix_RotateZF(chainRotZ, MTXMODE_APPLY);
|
||||
Matrix_Translate(chainsTranslateX, chainsTranslateY, 0.0f, MTXMODE_APPLY);
|
||||
if (entry->chainsScale != 1.0f) {
|
||||
Matrix_Scale(entry->chainsScale, entry->chainsScale, entry->chainsScale, MTXMODE_APPLY);
|
||||
}
|
||||
@@ -3867,7 +3866,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) {
|
||||
chainRotZ += rotZStep;
|
||||
}
|
||||
|
||||
Matrix_SetCurrentState(&baseMtxF);
|
||||
Matrix_Put(&baseMtxF);
|
||||
Matrix_Scale(frame * 0.1f, frame * 0.1f, frame * 0.1f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -4516,7 +4515,7 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
u32 gameplayFrames = globalCtx->gameplayFrames;
|
||||
f32 effectAlphaScaled;
|
||||
|
||||
currentMatrix = Matrix_GetCurrentState();
|
||||
currentMatrix = Matrix_GetCurrent();
|
||||
|
||||
// Apply sfx along with damage effect
|
||||
if ((actor != NULL) && (effectAlpha > 0.05f) && (globalCtx->gameOverCtx.state == 0)) {
|
||||
@@ -4565,15 +4564,15 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, KREG(20) + 200, KREG(21) + 200, KREG(22) + 255, (u8)alpha);
|
||||
|
||||
Matrix_InsertTranslation(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW);
|
||||
Matrix_Translate(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW);
|
||||
Matrix_Scale(frozenScale, frozenScale, frozenScale, MTXMODE_APPLY);
|
||||
|
||||
if (limbIndex & 1) {
|
||||
Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (limbIndex & 2) {
|
||||
Matrix_InsertZRotation_f(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(M_PI, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
@@ -4604,8 +4603,8 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, twoTexScrollParam * 3,
|
||||
twoTexScrollParam * -12, 32, 64, 1, 0, 0, 32, 32));
|
||||
|
||||
Matrix_InsertTranslation(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(steamScale, steamScale, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
@@ -4625,7 +4624,7 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
type = 255;
|
||||
}
|
||||
|
||||
Matrix_SetCurrentState(&globalCtx->billboardMtxF);
|
||||
Matrix_Put(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale((effectScale * 0.005f) * 1.35f, (effectScale * 0.005f), (effectScale * 0.005f) * 1.35f,
|
||||
MTXMODE_APPLY);
|
||||
|
||||
@@ -4651,7 +4650,7 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0,
|
||||
((limbIndex * 10 + gameplayFrames) * -20) & 0x1FF, 32, 128));
|
||||
|
||||
Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = limbPos->x;
|
||||
currentMatrix->mf[3][1] = limbPos->y;
|
||||
currentMatrix->mf[3][2] = limbPos->z;
|
||||
@@ -4688,12 +4687,12 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 100, 128);
|
||||
}
|
||||
|
||||
Matrix_SetCurrentState(&globalCtx->billboardMtxF);
|
||||
Matrix_Put(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(lightOrbsScale, lightOrbsScale, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
// Apply and draw a light orb over each limb of frozen actor
|
||||
for (limbIndex = 0; limbIndex < limbPosCount; limbIndex++, limbPos++) {
|
||||
Matrix_InsertZRotation_f(randPlusMinusPoint5Scaled(2 * M_PI), MTXMODE_APPLY);
|
||||
Matrix_RotateZF(randPlusMinusPoint5Scaled(2 * M_PI), MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = limbPos->x;
|
||||
currentMatrix->mf[3][1] = limbPos->y;
|
||||
currentMatrix->mf[3][2] = limbPos->z;
|
||||
@@ -4726,14 +4725,14 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, (u8)(sREG(20) + 255), (u8)(sREG(21) + 255), (u8)sREG(22), (u8)sREG(23));
|
||||
|
||||
Matrix_SetCurrentState(&globalCtx->billboardMtxF);
|
||||
Matrix_Put(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(electricSparksScale, electricSparksScale, electricSparksScale, MTXMODE_APPLY);
|
||||
|
||||
// Every limb draws two electric sparks at random orientations
|
||||
for (limbIndex = 0; limbIndex < limbPosCount; limbIndex++, limbPos++) {
|
||||
// first electric spark
|
||||
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->x;
|
||||
currentMatrix->mf[3][1] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->y;
|
||||
currentMatrix->mf[3][2] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->z;
|
||||
@@ -4744,8 +4743,8 @@ void Actor_DrawDamageEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbP
|
||||
gSPDisplayList(POLY_XLU_DISP++, gElectricSparkVtxDL);
|
||||
|
||||
// second electric spark
|
||||
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->x;
|
||||
currentMatrix->mf[3][1] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->y;
|
||||
currentMatrix->mf[3][2] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->z;
|
||||
|
||||
+12
-12
@@ -248,20 +248,20 @@ void func_800C0094(CollisionPoly* poly, f32 tx, f32 ty, f32 tz, MtxF* dest) {
|
||||
phi_f12 = 0.0f;
|
||||
}
|
||||
dest->xx = z_f14;
|
||||
dest->xy = (-nx) * phi_f14;
|
||||
dest->xz = (-nx) * phi_f12;
|
||||
dest->yx = nx;
|
||||
dest->yx = (-nx) * phi_f14;
|
||||
dest->zx = (-nx) * phi_f12;
|
||||
dest->xy = nx;
|
||||
dest->yy = ny;
|
||||
dest->yz = nz;
|
||||
dest->zx = 0.0f;
|
||||
dest->zy = -phi_f12;
|
||||
dest->zy = nz;
|
||||
dest->xz = 0.0f;
|
||||
dest->yz = -phi_f12;
|
||||
dest->zz = phi_f14;
|
||||
dest->wx = tx;
|
||||
dest->wy = ty;
|
||||
dest->wz = tz;
|
||||
dest->xw = 0.0f;
|
||||
dest->yw = 0.0f;
|
||||
dest->zw = 0.0f;
|
||||
dest->xw = tx;
|
||||
dest->yw = ty;
|
||||
dest->zw = tz;
|
||||
dest->wx = 0.0f;
|
||||
dest->wy = 0.0f;
|
||||
dest->wz = 0.0f;
|
||||
dest->ww = 1.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -3691,7 +3691,7 @@ void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider) {
|
||||
D_801EE1C0.x = collider->elements[i].dim.modelSphere.center.x;
|
||||
D_801EE1C0.y = collider->elements[i].dim.modelSphere.center.y;
|
||||
D_801EE1C0.z = collider->elements[i].dim.modelSphere.center.z;
|
||||
Matrix_MultiplyVector3fByState(&D_801EE1C0, &D_801EE1D0);
|
||||
Matrix_MultVec3f(&D_801EE1C0, &D_801EE1D0);
|
||||
collider->elements[i].dim.worldSphere.center.x = D_801EE1D0.x;
|
||||
collider->elements[i].dim.worldSphere.center.y = D_801EE1D0.y;
|
||||
collider->elements[i].dim.worldSphere.center.z = D_801EE1D0.z;
|
||||
@@ -3733,7 +3733,7 @@ void Collider_UpdateSphere(s32 limb, ColliderSphere* collider) {
|
||||
D_801EE1E0.x = collider->dim.modelSphere.center.x;
|
||||
D_801EE1E0.y = collider->dim.modelSphere.center.y;
|
||||
D_801EE1E0.z = collider->dim.modelSphere.center.z;
|
||||
Matrix_MultiplyVector3fByState(&D_801EE1E0, &D_801EE1F0);
|
||||
Matrix_MultVec3f(&D_801EE1E0, &D_801EE1F0);
|
||||
collider->dim.worldSphere.center.x = D_801EE1F0.x;
|
||||
collider->dim.worldSphere.center.y = D_801EE1F0.y;
|
||||
collider->dim.worldSphere.center.z = D_801EE1F0.z;
|
||||
|
||||
@@ -68,10 +68,10 @@ void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, GlobalCo
|
||||
func_8012C6FC(globalCtx->state.gfxCtx);
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, dispObj->color.r, dispObj->color.g, dispObj->color.b, dispObj->color.a);
|
||||
Matrix_InsertTranslation(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, MTXMODE_NEW);
|
||||
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_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_InsertRotation(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
|
||||
|
||||
gDPLoadTextureBlock(POLY_XLU_DISP++, 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);
|
||||
@@ -94,7 +94,7 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* arg1, GlobalContex
|
||||
|
||||
gSPSetLights1(POLY_XLU_DISP++, sDebugDisplayLight1);
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
|
||||
Matrix_SetTranslateRotateYXZ(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
|
||||
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void EffFootmark_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
for (footmark = globalCtx->footprintInfo, i = 0; i < 100; i++, footmark++) {
|
||||
if (footmark->actor != NULL) {
|
||||
Matrix_SetCurrentState(&footmark->displayMatrix);
|
||||
Matrix_Put(&footmark->displayMatrix);
|
||||
Matrix_Scale(footmark->size * (1.0f / 0x100) * 0.7f, 1, footmark->size * (1.0f / 0x100), MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD);
|
||||
|
||||
@@ -104,7 +104,7 @@ void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelAnimeCurve*
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
if (overrideLimbDraw == NULL ||
|
||||
(overrideLimbDraw != NULL && overrideLimbDraw(globalCtx, skelCurve, limbIndex, thisx))) {
|
||||
@@ -126,7 +126,7 @@ void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelAnimeCurve*
|
||||
pos.y = transform->y;
|
||||
pos.z = transform->z;
|
||||
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY);
|
||||
|
||||
if (lod == 0) {
|
||||
@@ -164,7 +164,7 @@ void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelAnimeCurve*
|
||||
SkelCurve_DrawLimb(globalCtx, limb->firstChildIdx, skelCurve, overrideLimbDraw, postLimbDraw, lod, thisx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->nextLimbIdx != LIMB_DONE) {
|
||||
SkelCurve_DrawLimb(globalCtx, limb->nextLimbIdx, skelCurve, overrideLimbDraw, postLimbDraw, lod, thisx);
|
||||
|
||||
@@ -159,7 +159,7 @@ void FireObj_Draw(GlobalContext* globalCtx, FireObj* fire) {
|
||||
vec.x = 0;
|
||||
vec.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000;
|
||||
vec.z = 0;
|
||||
Matrix_SetStateRotationAndTranslation(fire->position.x, fire->position.y, fire->position.z, &vec);
|
||||
Matrix_SetTranslateRotateYXZ(fire->position.x, fire->position.y, fire->position.z, &vec);
|
||||
Matrix_Scale(fire->xScale, fire->yScale, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
+1
-1
@@ -431,7 +431,7 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
|
||||
|
||||
gDPSetPrimColor(dl++, 0, 0, params->color[0], params->color[1], params->color[2], 50);
|
||||
|
||||
Matrix_InsertTranslation(params->x, params->y, params->z, MTXMODE_NEW);
|
||||
Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(dl++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
|
||||
+46
-46
@@ -33,7 +33,7 @@ void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
rot = jointTable[limbIndex];
|
||||
@@ -44,7 +44,7 @@ void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
|
||||
dList = limb->dLists[lod];
|
||||
if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, actor) == 0)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
Gfx* polyTemp = POLY_OPA_DISP;
|
||||
|
||||
@@ -63,7 +63,7 @@ void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
SkelAnime_DrawLimbLod(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor, lod);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbLod(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor,
|
||||
@@ -91,7 +91,7 @@ void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
pos.x = jointTable[0].x;
|
||||
@@ -102,7 +102,7 @@ void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
dList = rootLimb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
Gfx* polyTemp = POLY_OPA_DISP;
|
||||
|
||||
@@ -123,7 +123,7 @@ void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
lod);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -157,7 +157,7 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
newDList = limbDList = limb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(*mtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD);
|
||||
@@ -178,7 +178,7 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
lod, mtx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbLod(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor,
|
||||
@@ -211,7 +211,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
pos.x = jointTable[0].x;
|
||||
@@ -223,7 +223,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
newDList = limbDList = rootLimb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &newDList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Gfx* polyTemp = POLY_OPA_DISP;
|
||||
|
||||
@@ -246,7 +246,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
actor, lod, &mtx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -263,7 +263,7 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -274,7 +274,7 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
dList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
Gfx* polyTemp = POLY_OPA_DISP;
|
||||
|
||||
@@ -292,7 +292,7 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
|
||||
SkelAnime_DrawLimbOpa(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawLimbOpa(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor);
|
||||
@@ -318,7 +318,7 @@ void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
pos.x = jointTable[0].x;
|
||||
@@ -329,7 +329,7 @@ void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
dList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
Gfx* polyTemp = POLY_OPA_DISP;
|
||||
|
||||
@@ -347,7 +347,7 @@ void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
|
||||
SkelAnime_DrawLimbOpa(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -363,7 +363,7 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -376,7 +376,7 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
newDList = limbDList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(*limbMatricies);
|
||||
gSPMatrix(POLY_OPA_DISP++, *limbMatricies, G_MTX_LOAD);
|
||||
@@ -397,7 +397,7 @@ void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** s
|
||||
limbMatricies);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawFlexLimbOpa(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor,
|
||||
@@ -430,7 +430,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -442,7 +442,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
newDList = limbDList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &newDList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Gfx* polyTemp = POLY_OPA_DISP;
|
||||
|
||||
@@ -467,7 +467,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
actor, &mtx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex,
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -496,8 +496,8 @@ void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex,
|
||||
newDList = limbDList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_StatePush();
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
Matrix_Push();
|
||||
|
||||
transformLimbDraw(globalCtx, limbIndex, actor);
|
||||
|
||||
@@ -514,7 +514,7 @@ void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex,
|
||||
(*mtx)++;
|
||||
}
|
||||
}
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
@@ -526,7 +526,7 @@ void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex,
|
||||
transformLimbDraw, actor, mtx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
SkelAnime_DrawTransformFlexLimbOpa(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw,
|
||||
@@ -566,7 +566,7 @@ void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, V
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -578,8 +578,8 @@ void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, V
|
||||
newDList = limbDList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &newDList, &pos, &rot, actor)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_StatePush();
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
Matrix_Push();
|
||||
|
||||
transformLimbDraw(globalCtx, 1, actor);
|
||||
|
||||
@@ -595,7 +595,7 @@ void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, V
|
||||
Matrix_ToMtx(mtx++);
|
||||
}
|
||||
}
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
@@ -607,7 +607,7 @@ void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, V
|
||||
postLimbDraw, transformLimbDraw, actor, &mtx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -660,7 +660,7 @@ Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -673,7 +673,7 @@ Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
|
||||
dList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, actor, &gfx)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_LOAD);
|
||||
gSPDisplayList(&gfx[1], dList);
|
||||
@@ -690,7 +690,7 @@ Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
|
||||
gfx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawLimb(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, actor,
|
||||
@@ -716,7 +716,7 @@ Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -729,7 +729,7 @@ Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable
|
||||
dList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &dList, &pos, &rot, actor, &gfx)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_LOAD);
|
||||
gSPDisplayList(&gfx[1], dList);
|
||||
@@ -746,7 +746,7 @@ Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable
|
||||
actor, gfx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
return gfx;
|
||||
}
|
||||
@@ -763,7 +763,7 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
@@ -776,7 +776,7 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
|
||||
newDList = limbDList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, actor, &gfx)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
gSPMatrix(&gfx[0], Matrix_ToMtx(*mtx), G_MTX_LOAD);
|
||||
gSPDisplayList(&gfx[1], newDList);
|
||||
@@ -799,7 +799,7 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
|
||||
actor, mtx, gfx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
gfx = SkelAnime_DrawFlexLimb(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
|
||||
@@ -832,7 +832,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
|
||||
|
||||
gSPSegment(gfx++, 0x0D, mtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
|
||||
@@ -845,7 +845,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
|
||||
newDList = limbDList = rootLimb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, 1, &newDList, &pos, &rot, actor, &gfx)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
gSPMatrix(&gfx[0], Matrix_ToMtx(mtx), G_MTX_LOAD);
|
||||
gSPDisplayList(&gfx[1], newDList);
|
||||
@@ -868,7 +868,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
|
||||
actor, &mtx, gfx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
return gfx;
|
||||
}
|
||||
|
||||
+9
-9
@@ -13,13 +13,13 @@ void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* mod
|
||||
Vec3f normal;
|
||||
Vec3f sp44;
|
||||
|
||||
wTemp.x = mtx->wx;
|
||||
wTemp.y = mtx->wy;
|
||||
wTemp.z = mtx->wz;
|
||||
wTemp.x = mtx->xw;
|
||||
wTemp.y = mtx->yw;
|
||||
wTemp.z = mtx->zw;
|
||||
|
||||
mtx->wx = 0.0f;
|
||||
mtx->wy = 0.0f;
|
||||
mtx->wz = 0.0f;
|
||||
mtx->xw = 0.0f;
|
||||
mtx->yw = 0.0f;
|
||||
mtx->zw = 0.0f;
|
||||
|
||||
for (vertexEntry = skinVertices; vertexEntry < &skinVertices[modifEntry->vtxCount]; vertexEntry++) {
|
||||
vtx = &vtxBuf[vertexEntry->index];
|
||||
@@ -39,9 +39,9 @@ void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* mod
|
||||
vtx->n.n[2] = normal.z;
|
||||
}
|
||||
|
||||
mtx->wx = wTemp.x;
|
||||
mtx->wy = wTemp.y;
|
||||
mtx->wz = wTemp.z;
|
||||
mtx->xw = wTemp.x;
|
||||
mtx->yw = wTemp.y;
|
||||
mtx->zw = wTemp.z;
|
||||
}
|
||||
|
||||
void Skin_ApplyLimbModifications(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, s32 arg3) {
|
||||
|
||||
+264
-265
@@ -1,13 +1,11 @@
|
||||
#include "global.h"
|
||||
|
||||
// clang-format off
|
||||
MtxF sMtxFClear = {
|
||||
1.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
};
|
||||
// clang-format on
|
||||
MtxF sMtxFClear = { {
|
||||
{ 1.0f, 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 1.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 1.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f, 1.0f },
|
||||
} };
|
||||
|
||||
/**
|
||||
* Multiplies a 4 component row vector [ src , 1 ] by the matrix mf and writes the resulting 4 components to xyzDest
|
||||
@@ -16,10 +14,10 @@ MtxF sMtxFClear = {
|
||||
* \f[ [\texttt{xyzDest}, \texttt{wDest}] = [\texttt{src}, 1] \cdot [mf] \f]
|
||||
*/
|
||||
void SkinMatrix_Vec3fMtxFMultXYZW(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDest) {
|
||||
xyzDest->x = mf->wx + ((src->x * mf->xx) + (src->y * mf->yx) + (src->z * mf->zx));
|
||||
xyzDest->y = mf->wy + ((src->x * mf->xy) + (src->y * mf->yy) + (src->z * mf->zy));
|
||||
xyzDest->z = mf->wz + ((src->x * mf->xz) + (src->y * mf->yz) + (src->z * mf->zz));
|
||||
*wDest = mf->ww + ((src->x * mf->xw) + (src->y * mf->yw) + (src->z * mf->zw));
|
||||
xyzDest->x = mf->xw + ((src->x * mf->xx) + (src->y * mf->xy) + (src->z * mf->xz));
|
||||
xyzDest->y = mf->yw + ((src->x * mf->yx) + (src->y * mf->yy) + (src->z * mf->yz));
|
||||
xyzDest->z = mf->zw + ((src->x * mf->zx) + (src->y * mf->zy) + (src->z * mf->zz));
|
||||
*wDest = mf->ww + ((src->x * mf->wx) + (src->y * mf->wy) + (src->z * mf->wz));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,21 +27,22 @@ void SkinMatrix_Vec3fMtxFMultXYZW(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDe
|
||||
*/
|
||||
void SkinMatrix_Vec3fMtxFMultXYZ(MtxF* mf, Vec3f* src, Vec3f* dest) {
|
||||
f32 mx = mf->xx;
|
||||
f32 my = mf->yx;
|
||||
f32 mz = mf->zx;
|
||||
f32 mw = mf->wx;
|
||||
f32 my = mf->xy;
|
||||
f32 mz = mf->xz;
|
||||
f32 mw = mf->xw;
|
||||
|
||||
dest->x = mw + ((src->x * mx) + (src->y * my) + (src->z * mz));
|
||||
|
||||
mx = mf->xy;
|
||||
mx = mf->yx;
|
||||
my = mf->yy;
|
||||
mz = mf->zy;
|
||||
mw = mf->wy;
|
||||
mz = mf->yz;
|
||||
mw = mf->yw;
|
||||
dest->y = mw + ((src->x * mx) + (src->y * my) + (src->z * mz));
|
||||
|
||||
mx = mf->xz;
|
||||
my = mf->yz;
|
||||
mx = mf->zx;
|
||||
my = mf->zy;
|
||||
mz = mf->zz;
|
||||
mw = mf->wz;
|
||||
mw = mf->zw;
|
||||
dest->z = mw + ((src->x * mx) + (src->y * my) + (src->z * mz));
|
||||
}
|
||||
|
||||
@@ -59,122 +58,122 @@ void SkinMatrix_MtxFMtxFMult(MtxF* mfB, MtxF* mfA, MtxF* dest) {
|
||||
|
||||
//---COL1---
|
||||
f32 cx = mfB->xx;
|
||||
f32 cy = mfB->yx;
|
||||
f32 cz = mfB->zx;
|
||||
f32 cw = mfB->wx;
|
||||
f32 cy = mfB->xy;
|
||||
f32 cz = mfB->xz;
|
||||
f32 cw = mfB->xw;
|
||||
//--------
|
||||
|
||||
rx = mfA->xx;
|
||||
ry = mfA->xy;
|
||||
rz = mfA->xz;
|
||||
rw = mfA->xw;
|
||||
ry = mfA->yx;
|
||||
rz = mfA->zx;
|
||||
rw = mfA->wx;
|
||||
dest->xx = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->yx;
|
||||
rx = mfA->xy;
|
||||
ry = mfA->yy;
|
||||
rz = mfA->yz;
|
||||
rw = mfA->yw;
|
||||
dest->yx = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->zx;
|
||||
ry = mfA->zy;
|
||||
rz = mfA->zz;
|
||||
rw = mfA->zw;
|
||||
dest->zx = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->wx;
|
||||
ry = mfA->wy;
|
||||
rz = mfA->wz;
|
||||
rw = mfA->ww;
|
||||
dest->wx = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
//---2Col---
|
||||
cx = mfB->xy;
|
||||
cy = mfB->yy;
|
||||
cz = mfB->zy;
|
||||
cw = mfB->wy;
|
||||
//--------
|
||||
rx = mfA->xx;
|
||||
ry = mfA->xy;
|
||||
rz = mfA->xz;
|
||||
rw = mfA->xw;
|
||||
rz = mfA->zy;
|
||||
rw = mfA->wy;
|
||||
dest->xy = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->yx;
|
||||
ry = mfA->yy;
|
||||
rz = mfA->yz;
|
||||
rw = mfA->yw;
|
||||
dest->yy = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->zx;
|
||||
ry = mfA->zy;
|
||||
rx = mfA->xz;
|
||||
ry = mfA->yz;
|
||||
rz = mfA->zz;
|
||||
rw = mfA->zw;
|
||||
dest->zy = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->wx;
|
||||
ry = mfA->wy;
|
||||
rz = mfA->wz;
|
||||
rw = mfA->ww;
|
||||
dest->wy = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
//---3Col---
|
||||
cx = mfB->xz;
|
||||
cy = mfB->yz;
|
||||
cz = mfB->zz;
|
||||
cw = mfB->wz;
|
||||
//--------
|
||||
rx = mfA->xx;
|
||||
ry = mfA->xy;
|
||||
rz = mfA->xz;
|
||||
rw = mfA->xw;
|
||||
rw = mfA->wz;
|
||||
dest->xz = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->yx;
|
||||
rx = mfA->xw;
|
||||
ry = mfA->yw;
|
||||
rz = mfA->zw;
|
||||
rw = mfA->ww;
|
||||
dest->xw = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
//---2Col---
|
||||
cx = mfB->yx;
|
||||
cy = mfB->yy;
|
||||
cz = mfB->yz;
|
||||
cw = mfB->yw;
|
||||
//--------
|
||||
rx = mfA->xx;
|
||||
ry = mfA->yx;
|
||||
rz = mfA->zx;
|
||||
rw = mfA->wx;
|
||||
dest->yx = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->xy;
|
||||
ry = mfA->yy;
|
||||
rz = mfA->yz;
|
||||
rw = mfA->yw;
|
||||
rz = mfA->zy;
|
||||
rw = mfA->wy;
|
||||
dest->yy = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->xz;
|
||||
ry = mfA->yz;
|
||||
rz = mfA->zz;
|
||||
rw = mfA->wz;
|
||||
dest->yz = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->zx;
|
||||
ry = mfA->zy;
|
||||
rx = mfA->xw;
|
||||
ry = mfA->yw;
|
||||
rz = mfA->zw;
|
||||
rw = mfA->ww;
|
||||
dest->yw = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
//---3Col---
|
||||
cx = mfB->zx;
|
||||
cy = mfB->zy;
|
||||
cz = mfB->zz;
|
||||
cw = mfB->zw;
|
||||
//--------
|
||||
rx = mfA->xx;
|
||||
ry = mfA->yx;
|
||||
rz = mfA->zx;
|
||||
rw = mfA->wx;
|
||||
dest->zx = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->xy;
|
||||
ry = mfA->yy;
|
||||
rz = mfA->zy;
|
||||
rw = mfA->wy;
|
||||
dest->zy = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->xz;
|
||||
ry = mfA->yz;
|
||||
rz = mfA->zz;
|
||||
rw = mfA->zw;
|
||||
rw = mfA->wz;
|
||||
dest->zz = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->wx;
|
||||
ry = mfA->wy;
|
||||
rz = mfA->wz;
|
||||
rx = mfA->xw;
|
||||
ry = mfA->yw;
|
||||
rz = mfA->zw;
|
||||
rw = mfA->ww;
|
||||
dest->wz = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
dest->zw = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
//---4Col---
|
||||
cx = mfB->xw;
|
||||
cy = mfB->yw;
|
||||
cz = mfB->zw;
|
||||
cx = mfB->wx;
|
||||
cy = mfB->wy;
|
||||
cz = mfB->wz;
|
||||
cw = mfB->ww;
|
||||
//--------
|
||||
rx = mfA->xx;
|
||||
ry = mfA->xy;
|
||||
rz = mfA->xz;
|
||||
rw = mfA->xw;
|
||||
dest->xw = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
ry = mfA->yx;
|
||||
rz = mfA->zx;
|
||||
rw = mfA->wx;
|
||||
dest->wx = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->yx;
|
||||
rx = mfA->xy;
|
||||
ry = mfA->yy;
|
||||
rz = mfA->yz;
|
||||
rw = mfA->yw;
|
||||
dest->yw = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
rz = mfA->zy;
|
||||
rw = mfA->wy;
|
||||
dest->wy = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->zx;
|
||||
ry = mfA->zy;
|
||||
rx = mfA->xz;
|
||||
ry = mfA->yz;
|
||||
rz = mfA->zz;
|
||||
rw = mfA->zw;
|
||||
dest->zw = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
rw = mfA->wz;
|
||||
dest->wz = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
|
||||
rx = mfA->wx;
|
||||
ry = mfA->wy;
|
||||
rz = mfA->wz;
|
||||
rx = mfA->xw;
|
||||
ry = mfA->yw;
|
||||
rz = mfA->zw;
|
||||
rw = mfA->ww;
|
||||
dest->ww = (cx * rx) + (cy * ry) + (cz * rz) + (cw * rw);
|
||||
}
|
||||
@@ -188,39 +187,39 @@ void SkinMatrix_GetClear(MtxF** mfp) {
|
||||
|
||||
void SkinMatrix_Clear(MtxF* mf) {
|
||||
mf->xx = 1.0f;
|
||||
mf->xy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
mf->yx = 0.0f;
|
||||
mf->yy = 1.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zx = 0.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->zz = 1.0f;
|
||||
mf->zw = 0.0f;
|
||||
mf->wx = 0.0f;
|
||||
mf->xy = 0.0f;
|
||||
mf->yy = 1.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->wy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->zz = 1.0f;
|
||||
mf->wz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
mf->ww = 1.0f;
|
||||
}
|
||||
|
||||
void SkinMatrix_MtxFCopy(MtxF* src, MtxF* dest) {
|
||||
dest->xx = src->xx;
|
||||
dest->xy = src->xy;
|
||||
dest->xz = src->xz;
|
||||
dest->xw = src->xw;
|
||||
dest->yx = src->yx;
|
||||
dest->yy = src->yy;
|
||||
dest->yz = src->yz;
|
||||
dest->yw = src->yw;
|
||||
dest->zx = src->zx;
|
||||
dest->zy = src->zy;
|
||||
dest->zz = src->zz;
|
||||
dest->zw = src->zw;
|
||||
dest->wx = src->wx;
|
||||
dest->xy = src->xy;
|
||||
dest->yy = src->yy;
|
||||
dest->zy = src->zy;
|
||||
dest->wy = src->wy;
|
||||
dest->xz = src->xz;
|
||||
dest->yz = src->yz;
|
||||
dest->zz = src->zz;
|
||||
dest->wz = src->wz;
|
||||
dest->xw = src->xw;
|
||||
dest->yw = src->yw;
|
||||
dest->zw = src->zw;
|
||||
dest->ww = src->ww;
|
||||
}
|
||||
|
||||
@@ -282,18 +281,18 @@ s32 SkinMatrix_Invert(MtxF* src, MtxF* dest) {
|
||||
* Produces a matrix which scales x,y,z components of vectors or x,y,z rows of matrices (when applied on LHS)
|
||||
*/
|
||||
void SkinMatrix_SetScale(MtxF* mf, f32 x, f32 y, f32 z) {
|
||||
mf->xy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
mf->yx = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zx = 0.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
mf->wx = 0.0f;
|
||||
mf->xy = 0.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->wy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->wz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
mf->ww = 1.0f;
|
||||
mf->xx = x;
|
||||
mf->yy = y;
|
||||
@@ -307,16 +306,16 @@ void SkinMatrix_SetRotateRPY(MtxF* mf, s16 roll, s16 pitch, s16 yaw) {
|
||||
f32 cos2;
|
||||
f32 sin = Math_SinS(yaw);
|
||||
f32 cos = Math_CosS(yaw);
|
||||
f32 yx;
|
||||
f32 xy;
|
||||
f32 sin2;
|
||||
f32 zx;
|
||||
f32 xz;
|
||||
f32 yy;
|
||||
f32 zy;
|
||||
f32 yz;
|
||||
|
||||
mf->yy = cos;
|
||||
mf->yx = -sin;
|
||||
mf->xw = mf->yw = mf->zw = 0;
|
||||
mf->xy = -sin;
|
||||
mf->wx = mf->wy = mf->wz = 0;
|
||||
mf->xw = mf->yw = mf->zw = 0;
|
||||
mf->ww = 1;
|
||||
|
||||
if (pitch != 0) {
|
||||
@@ -324,19 +323,19 @@ void SkinMatrix_SetRotateRPY(MtxF* mf, s16 roll, s16 pitch, s16 yaw) {
|
||||
cos2 = Math_CosS(pitch);
|
||||
|
||||
mf->xx = cos * cos2;
|
||||
mf->zx = cos * sin2;
|
||||
mf->xz = cos * sin2;
|
||||
|
||||
mf->xy = sin * cos2;
|
||||
mf->zy = sin * sin2;
|
||||
mf->xz = -sin2;
|
||||
mf->yx = sin * cos2;
|
||||
mf->yz = sin * sin2;
|
||||
mf->zx = -sin2;
|
||||
mf->zz = cos2;
|
||||
} else {
|
||||
mf->xx = cos;
|
||||
if (1) {}
|
||||
if (1) {}
|
||||
zx = sin; // required to match
|
||||
mf->xy = sin;
|
||||
mf->xz = mf->zx = mf->zy = 0;
|
||||
xz = sin; // required to match
|
||||
mf->yx = sin;
|
||||
mf->zx = mf->xz = mf->yz = 0;
|
||||
mf->zz = 1;
|
||||
}
|
||||
|
||||
@@ -344,22 +343,22 @@ void SkinMatrix_SetRotateRPY(MtxF* mf, s16 roll, s16 pitch, s16 yaw) {
|
||||
sin2 = Math_SinS(roll);
|
||||
cos2 = Math_CosS(roll);
|
||||
|
||||
yx = mf->yx;
|
||||
zx = mf->zx;
|
||||
mf->yx = (yx * cos2) + (zx * sin2);
|
||||
mf->zx = (zx * cos2) - (yx * sin2);
|
||||
xy = mf->xy;
|
||||
xz = mf->xz;
|
||||
mf->xy = (xy * cos2) + (xz * sin2);
|
||||
mf->xz = (xz * cos2) - (xy * sin2);
|
||||
|
||||
if (1) {}
|
||||
zy = mf->zy;
|
||||
yz = mf->yz;
|
||||
yy = mf->yy;
|
||||
mf->yy = (yy * cos2) + (zy * sin2);
|
||||
mf->zy = (zy * cos2) - (yy * sin2);
|
||||
mf->yy = (yy * cos2) + (yz * sin2);
|
||||
mf->yz = (yz * cos2) - (yy * sin2);
|
||||
|
||||
if (cos2) {}
|
||||
mf->yz = mf->zz * sin2;
|
||||
mf->zy = mf->zz * sin2;
|
||||
mf->zz = mf->zz * cos2;
|
||||
} else {
|
||||
mf->yz = 0;
|
||||
mf->zy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,23 +369,23 @@ void SkinMatrix_SetRotateYRP(MtxF* mf, s16 yaw, s16 roll, s16 pitch) {
|
||||
f32 cos2;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
f32 xz;
|
||||
f32 zx;
|
||||
f32 sin2;
|
||||
f32 yz;
|
||||
f32 zy;
|
||||
f32 xx;
|
||||
f32 yx;
|
||||
f32 xy;
|
||||
|
||||
sin = Math_SinS(roll);
|
||||
cos = Math_CosS(roll);
|
||||
|
||||
mf->xx = cos;
|
||||
mf->xz = -sin;
|
||||
mf->zw = 0;
|
||||
mf->yw = 0;
|
||||
mf->xw = 0;
|
||||
mf->zx = -sin;
|
||||
mf->wz = 0;
|
||||
mf->wy = 0;
|
||||
mf->wx = 0;
|
||||
mf->zw = 0;
|
||||
mf->yw = 0;
|
||||
mf->xw = 0;
|
||||
mf->ww = 1;
|
||||
|
||||
if (yaw != 0) {
|
||||
@@ -394,19 +393,19 @@ void SkinMatrix_SetRotateYRP(MtxF* mf, s16 yaw, s16 roll, s16 pitch) {
|
||||
cos2 = Math_CosS(yaw);
|
||||
|
||||
mf->zz = cos * cos2;
|
||||
mf->yz = cos * sin2;
|
||||
mf->zy = cos * sin2;
|
||||
|
||||
mf->zx = sin * cos2;
|
||||
mf->yx = sin * sin2;
|
||||
mf->zy = -sin2;
|
||||
mf->xz = sin * cos2;
|
||||
mf->xy = sin * sin2;
|
||||
mf->yz = -sin2;
|
||||
mf->yy = cos2;
|
||||
} else {
|
||||
mf->zz = cos;
|
||||
if (1) {}
|
||||
if (1) {}
|
||||
yx = sin; // required to match
|
||||
mf->zx = sin;
|
||||
mf->yx = mf->yz = mf->zy = 0;
|
||||
xy = sin; // required to match
|
||||
mf->xz = sin;
|
||||
mf->xy = mf->zy = mf->yz = 0;
|
||||
mf->yy = 1;
|
||||
}
|
||||
|
||||
@@ -414,19 +413,19 @@ void SkinMatrix_SetRotateYRP(MtxF* mf, s16 yaw, s16 roll, s16 pitch) {
|
||||
sin2 = Math_SinS(pitch);
|
||||
cos2 = Math_CosS(pitch);
|
||||
xx = mf->xx;
|
||||
yx = mf->yx;
|
||||
mf->xx = (xx * cos2) + (yx * sin2);
|
||||
mf->yx = yx * cos2 - (xx * sin2);
|
||||
xy = mf->xy;
|
||||
mf->xx = (xx * cos2) + (xy * sin2);
|
||||
mf->xy = xy * cos2 - (xx * sin2);
|
||||
if (1) {}
|
||||
yz = mf->yz;
|
||||
xz = mf->xz;
|
||||
mf->xz = (xz * cos2) + (yz * sin2);
|
||||
mf->yz = (yz * cos2) - (xz * sin2);
|
||||
zy = mf->zy;
|
||||
zx = mf->zx;
|
||||
mf->zx = (zx * cos2) + (zy * sin2);
|
||||
mf->zy = (zy * cos2) - (zx * sin2);
|
||||
if (cos2) {}
|
||||
mf->xy = mf->yy * sin2;
|
||||
mf->yx = mf->yy * sin2;
|
||||
mf->yy = mf->yy * cos2;
|
||||
} else {
|
||||
mf->xy = 0;
|
||||
mf->yx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,22 +433,22 @@ void SkinMatrix_SetRotateYRP(MtxF* mf, s16 yaw, s16 roll, s16 pitch) {
|
||||
* Produces a matrix which translates a vector by amounts in the x, y and z directions
|
||||
*/
|
||||
void SkinMatrix_SetTranslate(MtxF* mf, f32 x, f32 y, f32 z) {
|
||||
mf->xy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
mf->yx = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zx = 0.0f;
|
||||
mf->wx = 0.0f;
|
||||
mf->xy = 0.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
mf->wy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->wz = 0.0f;
|
||||
mf->xx = 1.0f;
|
||||
mf->yy = 1.0f;
|
||||
mf->zz = 1.0f;
|
||||
mf->ww = 1.0f;
|
||||
mf->wx = x;
|
||||
mf->wy = y;
|
||||
mf->wz = z;
|
||||
mf->xw = x;
|
||||
mf->yw = y;
|
||||
mf->zw = z;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,19 +514,19 @@ void SkinMatrix_MtxFToMtx(MtxF* src, Mtx* dest) {
|
||||
m1[0] = (temp >> 0x10);
|
||||
m1[16 + 0] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xy * 0x10000;
|
||||
temp = src->yx * 0x10000;
|
||||
m1[1] = (temp >> 0x10);
|
||||
m1[16 + 1] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xz * 0x10000;
|
||||
temp = src->zx * 0x10000;
|
||||
m1[2] = (temp >> 0x10);
|
||||
m1[16 + 2] = temp & 0xFFFF;
|
||||
|
||||
temp = src->xw * 0x10000;
|
||||
temp = src->wx * 0x10000;
|
||||
m1[3] = (temp >> 0x10);
|
||||
m1[16 + 3] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yx * 0x10000;
|
||||
temp = src->xy * 0x10000;
|
||||
m1[4] = (temp >> 0x10);
|
||||
m1[16 + 4] = temp & 0xFFFF;
|
||||
|
||||
@@ -535,19 +534,19 @@ void SkinMatrix_MtxFToMtx(MtxF* src, Mtx* dest) {
|
||||
m1[5] = (temp >> 0x10);
|
||||
m1[16 + 5] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yz * 0x10000;
|
||||
temp = src->zy * 0x10000;
|
||||
m1[6] = (temp >> 0x10);
|
||||
m1[16 + 6] = temp & 0xFFFF;
|
||||
|
||||
temp = src->yw * 0x10000;
|
||||
temp = src->wy * 0x10000;
|
||||
m1[7] = (temp >> 0x10);
|
||||
m1[16 + 7] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zx * 0x10000;
|
||||
temp = src->xz * 0x10000;
|
||||
m1[8] = (temp >> 0x10);
|
||||
m1[16 + 8] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zy * 0x10000;
|
||||
temp = src->yz * 0x10000;
|
||||
m1[9] = (temp >> 0x10);
|
||||
m2[9] = temp & 0xFFFF;
|
||||
|
||||
@@ -555,19 +554,19 @@ void SkinMatrix_MtxFToMtx(MtxF* src, Mtx* dest) {
|
||||
m1[10] = (temp >> 0x10);
|
||||
m2[10] = temp & 0xFFFF;
|
||||
|
||||
temp = src->zw * 0x10000;
|
||||
temp = src->wz * 0x10000;
|
||||
m1[11] = (temp >> 0x10);
|
||||
m2[11] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wx * 0x10000;
|
||||
temp = src->xw * 0x10000;
|
||||
m1[12] = (temp >> 0x10);
|
||||
m2[12] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wy * 0x10000;
|
||||
temp = src->yw * 0x10000;
|
||||
m1[13] = (temp >> 0x10);
|
||||
m2[13] = temp & 0xFFFF;
|
||||
|
||||
temp = src->wz * 0x10000;
|
||||
temp = src->zw * 0x10000;
|
||||
m1[14] = (temp >> 0x10);
|
||||
m2[14] = temp & 0xFFFF;
|
||||
|
||||
@@ -612,21 +611,21 @@ void SkinMatrix_SetRotateAroundVec(MtxF* mf, s16 a, f32 x, f32 y, f32 z) {
|
||||
xz = x * z;
|
||||
|
||||
mf->xx = (1.0f - xx) * cosA + xx;
|
||||
mf->xy = (1.0f - cosA) * xy + z * sinA;
|
||||
mf->xz = (1.0f - cosA) * xz - y * sinA;
|
||||
mf->xw = 0.0f;
|
||||
mf->yx = (1.0f - cosA) * xy + z * sinA;
|
||||
mf->zx = (1.0f - cosA) * xz - y * sinA;
|
||||
mf->wx = 0.0f;
|
||||
|
||||
mf->yx = (1.0f - cosA) * xy - z * sinA;
|
||||
mf->xy = (1.0f - cosA) * xy - z * sinA;
|
||||
mf->yy = (1.0f - yy) * cosA + yy;
|
||||
mf->yz = (1.0f - cosA) * yz + x * sinA;
|
||||
mf->yw = 0.0f;
|
||||
mf->zy = (1.0f - cosA) * yz + x * sinA;
|
||||
mf->wy = 0.0f;
|
||||
|
||||
mf->zx = (1.0f - cosA) * xz + y * sinA;
|
||||
mf->zy = (1.0f - cosA) * yz - x * sinA;
|
||||
mf->xz = (1.0f - cosA) * xz + y * sinA;
|
||||
mf->yz = (1.0f - cosA) * yz - x * sinA;
|
||||
mf->zz = (1.0f - zz) * cosA + zz;
|
||||
mf->zw = 0.0f;
|
||||
mf->wz = 0.0f;
|
||||
|
||||
mf->wx = mf->wy = mf->wz = 0.0f;
|
||||
mf->xw = mf->yw = mf->zw = 0.0f;
|
||||
mf->ww = 1.0f;
|
||||
}
|
||||
|
||||
@@ -642,27 +641,27 @@ void SkinMatrix_SetXRotation(MtxF* mf, s16 a) {
|
||||
cosA = 1.0f;
|
||||
}
|
||||
|
||||
mf->xy = 0.0f;
|
||||
mf->xz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
|
||||
mf->yx = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
|
||||
mf->zx = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
|
||||
mf->wx = 0.0f;
|
||||
|
||||
mf->xy = 0.0f;
|
||||
mf->wy = 0.0f;
|
||||
|
||||
mf->xz = 0.0f;
|
||||
mf->wz = 0.0f;
|
||||
|
||||
mf->xw = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
|
||||
mf->xx = 1.0f;
|
||||
mf->ww = 1.0f;
|
||||
|
||||
mf->yy = cosA;
|
||||
mf->zz = cosA;
|
||||
mf->yz = sinA;
|
||||
mf->zy = -sinA;
|
||||
mf->zy = sinA;
|
||||
mf->yz = -sinA;
|
||||
}
|
||||
|
||||
void SkinMatrix_MulXRotation(MtxF* mf, s16 a) {
|
||||
@@ -675,25 +674,25 @@ void SkinMatrix_MulXRotation(MtxF* mf, s16 a) {
|
||||
sinA = Math_SinS(a);
|
||||
cosA = Math_CosS(a);
|
||||
|
||||
ry = mf->yx;
|
||||
rz = mf->zx;
|
||||
mf->yx = ry * cosA + rz * sinA;
|
||||
mf->zx = rz * cosA - ry * sinA;
|
||||
ry = mf->xy;
|
||||
rz = mf->xz;
|
||||
mf->xy = ry * cosA + rz * sinA;
|
||||
mf->xz = rz * cosA - ry * sinA;
|
||||
|
||||
ry = mf->yy;
|
||||
rz = mf->zy;
|
||||
rz = mf->yz;
|
||||
mf->yy = ry * cosA + rz * sinA;
|
||||
mf->zy = rz * cosA - ry * sinA;
|
||||
mf->yz = rz * cosA - ry * sinA;
|
||||
|
||||
ry = mf->yz;
|
||||
ry = mf->zy;
|
||||
rz = mf->zz;
|
||||
mf->yz = ry * cosA + rz * sinA;
|
||||
mf->zy = ry * cosA + rz * sinA;
|
||||
mf->zz = rz * cosA - ry * sinA;
|
||||
|
||||
ry = mf->yw;
|
||||
rz = mf->zw;
|
||||
mf->yw = ry * cosA + rz * sinA;
|
||||
mf->zw = rz * cosA - ry * sinA;
|
||||
ry = mf->wy;
|
||||
rz = mf->wz;
|
||||
mf->wy = ry * cosA + rz * sinA;
|
||||
mf->wz = rz * cosA - ry * sinA;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -709,27 +708,27 @@ void SkinMatrix_SetYRotation(MtxF* mf, s16 a) {
|
||||
cosA = 1.0f;
|
||||
}
|
||||
|
||||
mf->xy = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
|
||||
mf->yx = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
|
||||
mf->zy = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
|
||||
mf->wx = 0.0f;
|
||||
|
||||
mf->xy = 0.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->wy = 0.0f;
|
||||
|
||||
mf->yz = 0.0f;
|
||||
mf->wz = 0.0f;
|
||||
|
||||
mf->xw = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
|
||||
mf->yy = 1.0f;
|
||||
mf->ww = 1.0f;
|
||||
|
||||
mf->xx = cosA;
|
||||
mf->zz = cosA;
|
||||
mf->xz = -sinA;
|
||||
mf->zx = sinA;
|
||||
mf->zx = -sinA;
|
||||
mf->xz = sinA;
|
||||
}
|
||||
|
||||
void SkinMatrix_MulYRotation(MtxF* mf, s16 a) {
|
||||
@@ -743,24 +742,24 @@ void SkinMatrix_MulYRotation(MtxF* mf, s16 a) {
|
||||
cosA = Math_CosS(a);
|
||||
|
||||
rx = mf->xx;
|
||||
rz = mf->zx;
|
||||
rz = mf->xz;
|
||||
mf->xx = rx * cosA - rz * sinA;
|
||||
mf->zx = rx * sinA + rz * cosA;
|
||||
mf->xz = rx * sinA + rz * cosA;
|
||||
|
||||
rx = mf->xy;
|
||||
rz = mf->zy;
|
||||
mf->xy = rx * cosA - rz * sinA;
|
||||
mf->zy = rx * sinA + rz * cosA;
|
||||
rx = mf->yx;
|
||||
rz = mf->yz;
|
||||
mf->yx = rx * cosA - rz * sinA;
|
||||
mf->yz = rx * sinA + rz * cosA;
|
||||
|
||||
rx = mf->xz;
|
||||
rx = mf->zx;
|
||||
rz = mf->zz;
|
||||
mf->xz = rx * cosA - rz * sinA;
|
||||
mf->zx = rx * cosA - rz * sinA;
|
||||
mf->zz = rx * sinA + rz * cosA;
|
||||
|
||||
rx = mf->xw;
|
||||
rz = mf->zw;
|
||||
mf->xw = rx * cosA - rz * sinA;
|
||||
mf->zw = rx * sinA + rz * cosA;
|
||||
rx = mf->wx;
|
||||
rz = mf->wz;
|
||||
mf->wx = rx * cosA - rz * sinA;
|
||||
mf->wz = rx * sinA + rz * cosA;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -776,25 +775,25 @@ void SkinMatrix_SetZRotation(MtxF* mf, s16 a) {
|
||||
cosA = 1.0f;
|
||||
}
|
||||
|
||||
mf->xz = 0.0f;
|
||||
mf->xw = 0.0f;
|
||||
|
||||
mf->yz = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
|
||||
mf->zx = 0.0f;
|
||||
mf->zy = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
|
||||
mf->wx = 0.0f;
|
||||
|
||||
mf->zy = 0.0f;
|
||||
mf->wy = 0.0f;
|
||||
|
||||
mf->xz = 0.0f;
|
||||
mf->yz = 0.0f;
|
||||
mf->wz = 0.0f;
|
||||
|
||||
mf->xw = 0.0f;
|
||||
mf->yw = 0.0f;
|
||||
mf->zw = 0.0f;
|
||||
|
||||
mf->zz = 1.0f;
|
||||
mf->ww = 1.0f;
|
||||
|
||||
mf->xx = cosA;
|
||||
mf->yy = cosA;
|
||||
mf->xy = sinA;
|
||||
mf->yx = -sinA;
|
||||
mf->yx = sinA;
|
||||
mf->xy = -sinA;
|
||||
}
|
||||
|
||||
+15
-15
@@ -53,7 +53,7 @@ Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void**
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
|
||||
limbIndex++;
|
||||
rot = jointTable[limbIndex];
|
||||
@@ -63,8 +63,8 @@ Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void**
|
||||
newDList = limbDList = limb->dList;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, actor, &gfx)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_StatePush();
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
Matrix_Push();
|
||||
|
||||
transformLimbDraw(globalCtx, limbIndex, actor, &gfx);
|
||||
|
||||
@@ -77,7 +77,7 @@ Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void**
|
||||
Matrix_ToMtx(*mtx);
|
||||
(*mtx)++;
|
||||
}
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, limbIndex, &limbDList, &rot, actor, &gfx);
|
||||
@@ -86,7 +86,7 @@ Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void**
|
||||
gfx = SubS_DrawTransformFlexLimb(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
|
||||
transformLimbDraw, actor, mtx, gfx);
|
||||
}
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
if (limb->sibling != LIMB_DONE) {
|
||||
gfx = SubS_DrawTransformFlexLimb(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
|
||||
transformLimbDraw, actor, mtx, gfx);
|
||||
@@ -119,7 +119,7 @@ Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jo
|
||||
}
|
||||
|
||||
gSPSegment(gfx++, 0x0D, mtx);
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
|
||||
pos.x = jointTable->x;
|
||||
pos.y = jointTable->y;
|
||||
@@ -129,8 +129,8 @@ Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jo
|
||||
limbDList = rootLimb->dList;
|
||||
|
||||
if (overrideLimbDraw == NULL || !overrideLimbDraw(globalCtx, 1, &newDlist, &pos, &rot, actor, &gfx)) {
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_StatePush();
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
Matrix_Push();
|
||||
|
||||
transformLimbDraw(globalCtx, 1, actor, &gfx);
|
||||
|
||||
@@ -143,7 +143,7 @@ Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jo
|
||||
Matrix_ToMtx(mtx);
|
||||
mtx++;
|
||||
}
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
@@ -154,7 +154,7 @@ Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jo
|
||||
gfx = SubS_DrawTransformFlexLimb(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw,
|
||||
postLimbDraw, transformLimbDraw, actor, &mtx, gfx);
|
||||
}
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
return gfx;
|
||||
}
|
||||
|
||||
@@ -187,9 +187,9 @@ s32 SubS_UpdateLimb(s16 newRotZ, s16 newRotY, Vec3f* pos, Vec3s* rot, s32 stepRo
|
||||
Vec3s newRot;
|
||||
MtxF curState;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&zeroVec, &newPos);
|
||||
Matrix_CopyCurrentState(&curState);
|
||||
func_8018219C(&curState, &newRot, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&zeroVec, &newPos);
|
||||
Matrix_Get(&curState);
|
||||
Matrix_MtxFToYXZRot(&curState, &newRot, MTXMODE_NEW);
|
||||
*pos = newPos;
|
||||
|
||||
if (!stepRot && !overrideRot) {
|
||||
@@ -538,7 +538,7 @@ void SubS_GenShadowTex(Vec3f bodyPartsPos[], Vec3f* worldPos, u8* tex, f32 tween
|
||||
pos.z = bodyPartPos->z - worldPos->z;
|
||||
}
|
||||
|
||||
Matrix_MultiplyVector3fByState(&pos, &startVec);
|
||||
Matrix_MultVec3f(&pos, &startVec);
|
||||
startCol = 64.0f + startVec.x;
|
||||
startRow = 64.0f - startVec.z;
|
||||
SubS_FillShadowTex(startCol >> 1, startRow >> 1, tex, sizes[i]);
|
||||
@@ -554,7 +554,7 @@ void SubS_DrawShadowTex(Actor* actor, GameState* gameState, u8* tex) {
|
||||
func_8012C28C(gfxCtx);
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, 100);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0);
|
||||
Matrix_InsertTranslation(actor->world.pos.x, 0.0f, actor->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(actor->world.pos.x, 0.0f, actor->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(0.6f, 1.0f, 0.6f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gShadowDL);
|
||||
|
||||
+8
-8
@@ -262,15 +262,15 @@ s32 View_StepDistortion(View* view, Mtx* projectionMtx) {
|
||||
F32_LERPIMP(view->curDistortionScale.z, view->distortionScale.z, view->distortionSpeed);
|
||||
}
|
||||
|
||||
Matrix_FromRSPMatrix(projectionMtx, &projectionMtxF);
|
||||
Matrix_SetCurrentState(&projectionMtxF);
|
||||
Matrix_RotateStateAroundXAxis(view->curDistortionDirRot.x);
|
||||
Matrix_InsertYRotation_f(view->curDistortionDirRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(view->curDistortionDirRot.z, MTXMODE_APPLY);
|
||||
Matrix_MtxToMtxF(projectionMtx, &projectionMtxF);
|
||||
Matrix_Put(&projectionMtxF);
|
||||
Matrix_RotateXFApply(view->curDistortionDirRot.x);
|
||||
Matrix_RotateYF(view->curDistortionDirRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(view->curDistortionDirRot.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(view->curDistortionScale.x, view->curDistortionScale.y, view->curDistortionScale.z, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(-view->curDistortionDirRot.z, MTXMODE_APPLY);
|
||||
Matrix_InsertYRotation_f(-view->curDistortionDirRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(-view->curDistortionDirRot.x);
|
||||
Matrix_RotateZF(-view->curDistortionDirRot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(-view->curDistortionDirRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(-view->curDistortionDirRot.x);
|
||||
Matrix_ToMtx(projectionMtx);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
Mtx* sSkyboxDrawMatrix;
|
||||
|
||||
Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) {
|
||||
Matrix_InsertTranslation(x, y, z, MTXMODE_NEW);
|
||||
Matrix_Translate(x, y, z, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(skyboxCtx->rotX);
|
||||
Matrix_InsertYRotation_f(skyboxCtx->rotY, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(skyboxCtx->rotZ, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(skyboxCtx->rotX);
|
||||
Matrix_RotateYF(skyboxCtx->rotY, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(skyboxCtx->rotZ, MTXMODE_APPLY);
|
||||
return Matrix_ToMtx(sSkyboxDrawMatrix);
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyb
|
||||
|
||||
sSkyboxDrawMatrix = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
|
||||
Matrix_InsertTranslation(x, y, z, MTXMODE_NEW);
|
||||
Matrix_Translate(x, y, z, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(skyboxCtx->rotX);
|
||||
Matrix_InsertYRotation_f(skyboxCtx->rotY, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(skyboxCtx->rotZ, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(skyboxCtx->rotX);
|
||||
Matrix_RotateYF(skyboxCtx->rotY, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(skyboxCtx->rotZ, MTXMODE_APPLY);
|
||||
Matrix_ToMtx(sSkyboxDrawMatrix);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
+13
-10
@@ -1,22 +1,25 @@
|
||||
#include "libc/math.h"
|
||||
#include "macros.h"
|
||||
|
||||
// A slightly tweaked form of the coefficients of the Maclaurin series of sine up to x^9
|
||||
// [https://mathworld.wolfram.com/MaclaurinSeries.html].
|
||||
// The commented versions do not match.
|
||||
#pragma weak cosf = __cosf
|
||||
|
||||
// Coefficients of a degree 9 polynomial approximation of sine. It is not the Maclaurin polynamial, but some as-yet
|
||||
// undetermined more uniform approximation.
|
||||
static const du P[] = {
|
||||
{ 1.0 }, // 1
|
||||
{ -0.16666659550427756 }, // -1/3! = 1/6
|
||||
{ 0.008333066246082155 }, // 1/5! = 1/120
|
||||
{ -0.0001980960290193795 }, // -1/7! = -1/5040
|
||||
{ 0.000002605780637968037 }, // 1/9! = 1/362880
|
||||
{ 1.0 },
|
||||
{ -0.16666659550427756 },
|
||||
{ 0.008333066246082155 },
|
||||
{ -0.0001980960290193795 },
|
||||
{ 0.000002605780637968037 },
|
||||
};
|
||||
|
||||
static const du rpi = { 1 / 3.14159265358979323846 }; // 1/M_PI, "reciprocal of pi"
|
||||
|
||||
// pihi + pilo is the closest double to pi, this representation allows more precise calculations since pi itself is not
|
||||
// an exact float
|
||||
static const du pihi = { 3.1415926218032837 };
|
||||
|
||||
static const du pilo = { 3.178650954705639E-8 }; // pihi + pilo is the closest double to pi
|
||||
static const du pilo = { 3.178650954705639E-8 };
|
||||
|
||||
static const fu zero = { 0x00000000 };
|
||||
|
||||
@@ -28,7 +31,7 @@ f32 __cosf(f32 x) {
|
||||
f32 absx;
|
||||
f64 dx; // x promoted to double
|
||||
f64 xSq; // square of dx
|
||||
f64 polyApprox; // Most of Maclaurin polynomial of sin(x) of degree 9
|
||||
f64 polyApprox; // Most of the polynomial approximation to sin(x)
|
||||
f64 dn; // n promoted to double
|
||||
s32 n; // number of multiples of pi away from the first half-period
|
||||
f64 result;
|
||||
|
||||
@@ -7,7 +7,7 @@ void guPerspectiveF(float mf[4][4], u16* perspNorm, float fovy, float aspect, fl
|
||||
|
||||
guMtxIdentF(mf);
|
||||
fovy *= 3.1415926 / 180.0;
|
||||
cot = __cosf(fovy / 2) / __sinf(fovy / 2);
|
||||
cot = cosf(fovy / 2) / sinf(fovy / 2);
|
||||
|
||||
mf[0][0] = cot / aspect;
|
||||
mf[1][1] = cot;
|
||||
|
||||
@@ -13,12 +13,12 @@ void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f3
|
||||
pitch *= D_80134D00;
|
||||
yaw *= D_80134D00;
|
||||
|
||||
sinr = __sinf(rot);
|
||||
cosr = __cosf(rot);
|
||||
sinp = __sinf(pitch);
|
||||
cosp = __cosf(pitch);
|
||||
sinh = __sinf(yaw);
|
||||
cosh = __cosf(yaw);
|
||||
sinr = sinf(rot);
|
||||
cosr = cosf(rot);
|
||||
sinp = sinf(pitch);
|
||||
cosp = cosf(pitch);
|
||||
sinh = sinf(yaw);
|
||||
cosh = cosf(yaw);
|
||||
|
||||
mf[0][0] = (cosp * cosh) * scale;
|
||||
mf[0][1] = (cosp * sinh) * scale;
|
||||
|
||||
@@ -16,8 +16,8 @@ void guRotateF(float m[4][4], float a, float x, float y, float z) {
|
||||
|
||||
a = a * D_80097F90;
|
||||
|
||||
sine = __sinf(a);
|
||||
cosine = __cosf(a);
|
||||
sine = sinf(a);
|
||||
cosine = cosf(a);
|
||||
|
||||
ab = x * y * (1 - cosine);
|
||||
bc = y * z * (1 - cosine);
|
||||
|
||||
+13
-10
@@ -1,22 +1,25 @@
|
||||
#include "libc/math.h"
|
||||
#include "macros.h"
|
||||
|
||||
// A slightly tweaked form of the coefficients of the Maclaurin series of sine up to x^9
|
||||
// [https://mathworld.wolfram.com/MaclaurinSeries.html].
|
||||
// The commented versions do not match.
|
||||
#pragma weak sinf = __sinf
|
||||
|
||||
// Coefficients of a degree 9 polynomial approximation of sine. It is not the Maclaurin polynamial, but some as-yet
|
||||
// undetermined more uniform approximation.
|
||||
static const du P[] = {
|
||||
{ 1.0 }, // 1
|
||||
{ -0.16666659550427756 }, // -1/3! = 1/6
|
||||
{ 0.008333066246082155 }, // 1/5! = 1/120
|
||||
{ -0.0001980960290193795 }, // -1/7! = -1/5040
|
||||
{ 0.000002605780637968037 }, // 1/9! = 1/362880
|
||||
{ 1.0 },
|
||||
{ -0.16666659550427756 },
|
||||
{ 0.008333066246082155 },
|
||||
{ -0.0001980960290193795 },
|
||||
{ 0.000002605780637968037 },
|
||||
};
|
||||
|
||||
static const du rpi = { 1 / 3.14159265358979323846 }; // 1/M_PI, "reciprocal of pi"
|
||||
|
||||
// pihi + pilo is the closest double to pi, this representation allows more precise calculations since pi itself is not
|
||||
// an exact float
|
||||
static const du pihi = { 3.1415926218032837 };
|
||||
|
||||
static const du pilo = { 3.178650954705639E-8 }; // pihi + pilo is the closest double to pi
|
||||
static const du pilo = { 3.178650954705639E-8 };
|
||||
|
||||
static const fu zero = { 0x00000000 };
|
||||
|
||||
@@ -26,7 +29,7 @@ static const fu zero = { 0x00000000 };
|
||||
f32 __sinf(f32 x) {
|
||||
f64 dx; // x promoted to double
|
||||
f64 xSq; // square of dx
|
||||
f64 polyApprox; // Most of Maclaurin polynomial of sin(x) of degree 9
|
||||
f64 polyApprox; // Most of the polynomial approximation to sin(x)
|
||||
f64 dn; // n promoted to double
|
||||
s32 n; // number of multiples of pi away from the first half-period
|
||||
f64 result;
|
||||
|
||||
@@ -309,14 +309,14 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) {
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C10, &this->unk1E0);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C28, &sp5C);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C34, &sp50);
|
||||
Matrix_MultVec3f(&D_808C1C10, &this->unk1E0);
|
||||
Matrix_MultVec3f(&D_808C1C28, &sp5C);
|
||||
Matrix_MultVec3f(&D_808C1C34, &sp50);
|
||||
this->unk1C4.active = false;
|
||||
} else {
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C1C, &this->unk1E0);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C40, &sp5C);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C4C, &sp50);
|
||||
Matrix_MultVec3f(&D_808C1C1C, &this->unk1E0);
|
||||
Matrix_MultVec3f(&D_808C1C40, &sp5C);
|
||||
Matrix_MultVec3f(&D_808C1C4C, &sp50);
|
||||
}
|
||||
func_80126440(globalCtx, &this->collider, &this->unk1C4, &sp5C, &sp50);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
@@ -324,13 +324,12 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_link_child_DL_01D960);
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Math_Vec3f_Diff(&player->rightHandWorld.pos, &this->actor.world.pos, &sp68);
|
||||
sp48 = SQXZ(sp68);
|
||||
sp4C = sqrtf(SQXZ(sp68));
|
||||
Matrix_RotateY(Math_Atan2S(sp68.x, sp68.z), MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(Math_Atan2S(-sp68.y, sp4C), MTXMODE_APPLY);
|
||||
Matrix_RotateYS(Math_Atan2S(sp68.x, sp68.z), MTXMODE_APPLY);
|
||||
Matrix_RotateXS(Math_Atan2S(-sp68.y, sp4C), MTXMODE_APPLY);
|
||||
f0 = sqrtf(SQ(sp68.y) + sp48);
|
||||
Matrix_Scale(0.015f, 0.015f, f0 * 0.01f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -225,15 +225,15 @@ void FireArrow_SetQuadVerticies(ArrowFire* this) {
|
||||
Vec3f sp2C;
|
||||
Vec3f sp20;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&D_80922284, &sp44);
|
||||
Matrix_MultiplyVector3fByState(&D_80922290, &sp38);
|
||||
Matrix_MultiplyVector3fByState(&D_8092229C, &sp2C);
|
||||
Matrix_MultiplyVector3fByState(&D_809222A8, &sp20);
|
||||
Matrix_MultVec3f(&D_80922284, &sp44);
|
||||
Matrix_MultVec3f(&D_80922290, &sp38);
|
||||
Matrix_MultVec3f(&D_8092229C, &sp2C);
|
||||
Matrix_MultVec3f(&D_809222A8, &sp20);
|
||||
Collider_SetQuadVertices(&this->collider1, &sp44, &sp38, &sp2C, &sp20);
|
||||
Matrix_MultiplyVector3fByState(&D_809222B4, &sp44);
|
||||
Matrix_MultiplyVector3fByState(&D_809222C0, &sp38);
|
||||
Matrix_MultiplyVector3fByState(&D_809222CC, &sp2C);
|
||||
Matrix_MultiplyVector3fByState(&D_809222D8, &sp20);
|
||||
Matrix_MultVec3f(&D_809222B4, &sp44);
|
||||
Matrix_MultVec3f(&D_809222C0, &sp38);
|
||||
Matrix_MultVec3f(&D_809222CC, &sp2C);
|
||||
Matrix_MultVec3f(&D_809222D8, &sp20);
|
||||
Collider_SetQuadVertices(&this->collider2, &sp44, &sp38, &sp2C, &sp20);
|
||||
}
|
||||
|
||||
@@ -249,10 +249,10 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor* transform = (arrow->unk_261 & 2) ? &this->actor : &arrow->actor;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
Matrix_InsertTranslation(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(transform->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(transform->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
if (this->screenFillIntensity > 0.0f) {
|
||||
@@ -271,16 +271,16 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 200, 0, this->alpha);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128);
|
||||
|
||||
Matrix_InsertRotation(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
|
||||
if (this->timer != 0) {
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
} else {
|
||||
Matrix_InsertTranslation(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
Matrix_Scale(this->radius * 0.2f, this->height * 4.0f, this->radius * 0.2f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
|
||||
@@ -196,10 +196,10 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(transform->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(transform->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
|
||||
// Draw blue effect over the screen when arrow hits
|
||||
@@ -217,14 +217,14 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, (s32)(this->alpha * 0.5f) & 0xFF);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 128);
|
||||
Matrix_InsertRotation(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
if (this->timer != 0) {
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
} else {
|
||||
Matrix_InsertTranslation(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
Matrix_Scale(this->radius * 0.2f, this->height * 3.0f, this->radius * 0.2f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gIceArrowMaterialDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++,
|
||||
|
||||
@@ -190,10 +190,10 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(transform->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(transform->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
if (this->screenFillIntensity > 0.0f) {
|
||||
POLY_XLU_DISP = func_8012BFC4(POLY_XLU_DISP);
|
||||
@@ -210,14 +210,14 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, this->alpha);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 128);
|
||||
|
||||
Matrix_InsertRotation(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
Matrix_RotateZYX(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
if (this->timer != 0) {
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
} else {
|
||||
Matrix_InsertTranslation(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
Matrix_Scale(this->radius * 0.2f, this->height * 4.0f, this->radius * 0.2f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gLightArrowMaterialDL);
|
||||
|
||||
@@ -74,15 +74,15 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
|
||||
s16 rotZ = this->dyna.actor.shape.rot.z & 0x1FFF;
|
||||
|
||||
if (flag40 && (rotZ < 0x1B58) && (rotZ >= 0x1388)) {
|
||||
Matrix_RotateY(this->dyna.actor.home.rot.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->dyna.actor.home.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->dyna.actor.home.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.home.rot.z, MTXMODE_APPLY);
|
||||
for (i = 0; i < 4; i++) {
|
||||
if ((u32)Rand_Next() >= 0x40000000) {
|
||||
splashOffset.x = sExitSplashOffsets[i].x - (Rand_ZeroOne() * 30.0f);
|
||||
splashOffset.y = sExitSplashOffsets[i].y;
|
||||
splashOffset.z = sExitSplashOffsets[i].z;
|
||||
Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
|
||||
Matrix_MultVec3f(&splashOffset, &splashSpawnPos);
|
||||
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
splashSpawnPos.y += this->dyna.actor.world.pos.y;
|
||||
splashSpawnPos.z += this->dyna.actor.world.pos.z + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
@@ -92,15 +92,15 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
if ((rotZ < 0x1F4) && (rotZ >= 0)) {
|
||||
if (flag40) {
|
||||
Matrix_RotateY(this->dyna.actor.home.rot.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->dyna.actor.home.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->dyna.actor.home.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.home.rot.z, MTXMODE_APPLY);
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
splashOffset.x = sEnterSplashOffsets[i].x + (Rand_ZeroOne() * 10.0f);
|
||||
splashOffset.y = sEnterSplashOffsets[i].y;
|
||||
splashOffset.z = sEnterSplashOffsets[i].z;
|
||||
Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
|
||||
Matrix_MultVec3f(&splashOffset, &splashSpawnPos);
|
||||
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
splashSpawnPos.y += this->dyna.actor.world.pos.y;
|
||||
splashSpawnPos.z += this->dyna.actor.world.pos.z + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
|
||||
@@ -110,22 +110,22 @@ void func_80B823B0(BgDblueBalance* this) {
|
||||
s32 pad;
|
||||
Vec3f sp28;
|
||||
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
|
||||
sp28.x = -138.28f;
|
||||
sp28.y = 0.0f;
|
||||
sp28.z = 0.0f;
|
||||
|
||||
if (this->unk_15C != NULL) {
|
||||
Matrix_MultiplyVector3fByState(&sp28, &this->unk_15C->dyna.actor.world.pos);
|
||||
Matrix_MultVec3f(&sp28, &this->unk_15C->dyna.actor.world.pos);
|
||||
}
|
||||
|
||||
sp28.x = 138.28f;
|
||||
if (this->unk_160 != NULL) {
|
||||
Matrix_MultiplyVector3fByState(&sp28, &this->unk_160->dyna.actor.world.pos);
|
||||
Matrix_MultVec3f(&sp28, &this->unk_160->dyna.actor.world.pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,16 +136,16 @@ s32 func_80B82454(BgDblueBalance* this, GlobalContext* globalCtx) {
|
||||
Vec3f sp48;
|
||||
Vec3f sp3C;
|
||||
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
|
||||
sp48.x = -138.28f;
|
||||
sp48.y = 0.0f;
|
||||
sp48.z = 0.0f;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&sp48, &sp3C);
|
||||
Matrix_MultVec3f(&sp48, &sp3C);
|
||||
|
||||
this->unk_15C = (BgDblueBalance*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_DBLUE_BALANCE, sp3C.x,
|
||||
sp3C.y, sp3C.z, 0, this->dyna.actor.shape.rot.y, 0, 0x100);
|
||||
@@ -157,7 +157,7 @@ s32 func_80B82454(BgDblueBalance* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
sp48.x = 138.28f;
|
||||
Matrix_MultiplyVector3fByState(&sp48, &sp3C);
|
||||
Matrix_MultVec3f(&sp48, &sp3C);
|
||||
|
||||
this->unk_160 = (BgDblueBalance*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_DBLUE_BALANCE, sp3C.x,
|
||||
sp3C.y, sp3C.z, 0, this->dyna.actor.shape.rot.y, 0, 0x200);
|
||||
@@ -212,20 +212,20 @@ void func_80B8264C(BgDblueBalance* this) {
|
||||
}
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0, phi_s0 = &this->unk_188[0], phi_s2 = 0; i < ARRAY_COUNT(this->unk_188);
|
||||
i++, phi_s2 += 0x2000, phi_s0++) {
|
||||
phi_s0->unk_0C = this->dyna.actor.shape.rot.x + phi_s2;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertXRotation_s(phi_s0->unk_0C, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(-545.0f, 0.0f, 270.0f, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&sp78);
|
||||
Matrix_StatePop();
|
||||
Matrix_MultiplyVector3fByState(&sp78, &phi_s0->unk_00);
|
||||
Matrix_Push();
|
||||
Matrix_RotateXS(phi_s0->unk_0C, MTXMODE_NEW);
|
||||
Matrix_Translate(-545.0f, 0.0f, 270.0f, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&sp78);
|
||||
Matrix_Pop();
|
||||
Matrix_MultVec3f(&sp78, &phi_s0->unk_00);
|
||||
|
||||
temp_f0 = (sp78.z - 135.0f);
|
||||
if (sp78.z > 135.0f) {
|
||||
@@ -486,10 +486,10 @@ void func_80B82DE0(BgDblueBalance* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_182) {
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND);
|
||||
sp5C = this->unk_15C;
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateY(BINANG_SUB(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(45.0f, &sp60);
|
||||
Matrix_StatePop();
|
||||
Matrix_Push();
|
||||
Matrix_RotateYS(BINANG_SUB(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW);
|
||||
Matrix_MultVecZ(45.0f, &sp60);
|
||||
Matrix_Pop();
|
||||
|
||||
sp50.x = sp5C->dyna.actor.world.pos.x + sp60.x;
|
||||
sp50.y = this->unk_228;
|
||||
@@ -511,10 +511,10 @@ void func_80B82DE0(BgDblueBalance* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_182) {
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND);
|
||||
sp3C = this->unk_160;
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateY(BINANG_ADD(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(30.0f, &sp40);
|
||||
Matrix_StatePop();
|
||||
Matrix_Push();
|
||||
Matrix_RotateYS(BINANG_ADD(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW);
|
||||
Matrix_MultVecZ(30.0f, &sp40);
|
||||
Matrix_Pop();
|
||||
|
||||
sp30.x = sp3C->dyna.actor.world.pos.x + sp40.x;
|
||||
sp30.y = this->unk_228;
|
||||
@@ -653,9 +653,9 @@ void BgDblueBalance_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if (!(BGDBLUEBALANCE_GET_300(&this->dyna.actor)) && (this->unk_160 != NULL)) {
|
||||
AnimatedMat_Draw(globalCtx, D_80B83C74);
|
||||
sp38 = this->unk_160;
|
||||
Matrix_SetStateRotationAndTranslation(sp38->dyna.actor.world.pos.x, sp38->dyna.actor.world.pos.y,
|
||||
sp38->dyna.actor.world.pos.z, &sp38->dyna.actor.shape.rot);
|
||||
Matrix_InsertTranslation(30.0f, 15.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_SetTranslateRotateYXZ(sp38->dyna.actor.world.pos.x, sp38->dyna.actor.world.pos.y,
|
||||
sp38->dyna.actor.world.pos.z, &sp38->dyna.actor.shape.rot);
|
||||
Matrix_Translate(30.0f, 15.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(sp38->dyna.actor.scale.x, sp38->dyna.actor.scale.y, sp38->dyna.actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -708,9 +708,9 @@ void func_80B83758(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
for (i = 0, ptr = &this->unk_188[0]; i < ARRAY_COUNT(this->unk_188); i++, ptr++) {
|
||||
if (ptr->unk_0E != 0) {
|
||||
Matrix_InsertTranslation(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(ptr->unk_0C, MTXMODE_APPLY);
|
||||
Matrix_Translate(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(ptr->unk_0C, MTXMODE_APPLY);
|
||||
Matrix_Scale(ptr->unk_10, ptr->unk_10, ptr->unk_10, MTXMODE_APPLY);
|
||||
|
||||
temp = ptr->unk_0E * (f32)this->unk_183 * 0.003921569f;
|
||||
|
||||
@@ -259,9 +259,9 @@ void BgDblueMovebg_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->unk_178 = func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC);
|
||||
this->unk_1CC = D_80A2B96C[this->unk_178];
|
||||
this->unk_1CE = this->unk_1CC;
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledX(2240.0f, &this->unk_190);
|
||||
Matrix_GetStateTranslationAndScaledX(-10.0f, &this->unk_19C);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_MultVecX(2240.0f, &this->unk_190);
|
||||
Matrix_MultVecX(-10.0f, &this->unk_19C);
|
||||
Math_Vec3f_Sum(&this->unk_190, &this->dyna.actor.world.pos, &this->unk_190);
|
||||
Math_Vec3f_Sum(&this->unk_19C, &this->dyna.actor.world.pos, &this->unk_19C);
|
||||
D_80A2BBF0 = this;
|
||||
@@ -591,10 +591,10 @@ void func_80A2ABD0(BgDblueMovebg* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
for (j = 0; j < ARRAY_COUNT(this->unk_1D8[0]); j++) {
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.shape.rot.x + (j * 0x2000), MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultiplyVector3fByState(&D_80A2B988, &spAC);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->dyna.actor.shape.rot.x + (j * 0x2000), MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultVec3f(&D_80A2B988, &spAC);
|
||||
Math_Vec3f_Sum(&this->dyna.actor.world.pos, &spAC, &spAC);
|
||||
Math_Vec3f_Copy(&this->unk_238[i][j], &spAC);
|
||||
temp_f20 = spAC.y - this->unk_2F8[i]->world.pos.y;
|
||||
@@ -770,7 +770,7 @@ void BgDblueMovebg_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
Gfx* gfx;
|
||||
Gfx* gfx2;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -808,7 +808,7 @@ void BgDblueMovebg_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
}
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -817,11 +817,11 @@ void BgDblueMovebg_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
gfx = func_8012C2B4(POLY_XLU_DISP);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_1D8[0]); i++) {
|
||||
@@ -834,11 +834,11 @@ void BgDblueMovebg_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
(s32)(((globalCtx->gameplayFrames % 128) * -9.0f) / this->unk_1F8[j][i]),
|
||||
0x20, 0x20, 1, 0, 0, 0x20, 0x20));
|
||||
}
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertXRotation_s(i * 0x2000, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(1785.0f, 0.0f, 270.0f, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
Matrix_RotateXS(i * 0x2000, MTXMODE_APPLY);
|
||||
Matrix_Translate(1785.0f, 0.0f, 270.0f, MTXMODE_APPLY);
|
||||
if (j != 0) {
|
||||
Matrix_InsertZRotation_s(-0x8000, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-0x8000, MTXMODE_APPLY);
|
||||
}
|
||||
Matrix_Scale(this->unk_1F8[j][i] * this->dyna.actor.scale.x,
|
||||
this->unk_1F8[j][i] * this->dyna.actor.scale.y,
|
||||
@@ -849,7 +849,7 @@ void BgDblueMovebg_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
gDPSetEnvColor(gfx++, 255, 255, 255, this->unk_1D8[j][i]);
|
||||
gSPDisplayList(gfx++, object_dblue_object_DL_00CD10);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,10 +314,10 @@ void func_80B84610(BgDblueWaterfall* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateY(BINANG_ADD(this->actor.yawTowardsPlayer, 0x4000), MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(this->unk_1A8, &sp34);
|
||||
Matrix_StatePop();
|
||||
Matrix_Push();
|
||||
Matrix_RotateYS(BINANG_ADD(this->actor.yawTowardsPlayer, 0x4000), MTXMODE_NEW);
|
||||
Matrix_MultVecZ(this->unk_1A8, &sp34);
|
||||
Matrix_Pop();
|
||||
|
||||
player->actor.world.pos.x += sp34.x;
|
||||
player->actor.world.pos.z += sp34.z;
|
||||
|
||||
@@ -118,10 +118,10 @@ void BgHakaTomb_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Vec3f vec;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.world.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultiplyVector3fByState(&D_80BD68A4, &vec);
|
||||
Matrix_RotateYS(this->dyna.actor.world.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->dyna.actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.world.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultVec3f(&D_80BD68A4, &vec);
|
||||
Math_Vec3f_Sum(&this->dyna.actor.world.pos, &vec, &this->dyna.actor.focus.pos);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ void func_80ABBFC0(BgHakuginBombwall* this, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
temp = (i + 1) * (80.0f / 3.0f);
|
||||
@@ -146,8 +146,8 @@ void func_80ABBFC0(BgHakuginBombwall* this, GlobalContext* globalCtx) {
|
||||
spCC.y = (Rand_ZeroOne() * 7.0f) - 2.0f;
|
||||
spCC.z = spD8.z * 0.3f;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&spD8, &spF0);
|
||||
Matrix_MultiplyVector3fByState(&spCC, &spE4);
|
||||
Matrix_MultVec3f(&spD8, &spF0);
|
||||
Matrix_MultVec3f(&spCC, &spE4);
|
||||
|
||||
spF0.x += this->dyna.actor.world.pos.x;
|
||||
spF0.y += this->dyna.actor.world.pos.y;
|
||||
@@ -245,7 +245,7 @@ void func_80ABC58C(BgHakuginBombwall* this, GlobalContext* globalCtx) {
|
||||
spA8.y = 0.0f;
|
||||
spB4.y = 0.3f;
|
||||
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
|
||||
for (i = 0, phi_s1 = 0; i < 21; i++, phi_s1 += 0x618) {
|
||||
temp_f20 = Math_SinS(phi_s1);
|
||||
@@ -261,9 +261,9 @@ void func_80ABC58C(BgHakuginBombwall* this, GlobalContext* globalCtx) {
|
||||
spB4.x = spA8.x * -0.09f;
|
||||
spB4.z = spA8.z * -0.09f;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&sp9C, &spC0);
|
||||
Matrix_MultiplyVector3fByState(&spA8, &spCC);
|
||||
Matrix_MultiplyVector3fByState(&spB4, &spD8);
|
||||
Matrix_MultVec3f(&sp9C, &spC0);
|
||||
Matrix_MultVec3f(&spA8, &spCC);
|
||||
Matrix_MultVec3f(&spB4, &spD8);
|
||||
|
||||
spC0.x += this->dyna.actor.world.pos.x;
|
||||
spC0.y += this->dyna.actor.world.pos.y;
|
||||
|
||||
@@ -230,7 +230,7 @@ BgHakuginPostUnkStruct1* func_80A9B32C(BgHakuginPostUnkStruct* unkStruct, BgHaku
|
||||
}
|
||||
|
||||
void func_80A9B384(Vec3f* arg0) {
|
||||
MtxF* matrix = Matrix_GetCurrentState();
|
||||
MtxF* matrix = Matrix_GetCurrent();
|
||||
|
||||
matrix->mf[3][0] = arg0->x;
|
||||
matrix->mf[3][1] = arg0->y;
|
||||
@@ -1010,8 +1010,8 @@ void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < D_80A9E028.count; i++) {
|
||||
@@ -1032,8 +1032,8 @@ void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx) {
|
||||
for (i = 0; i < ARRAY_COUNT(D_80A9E028.unk_02A4); i++) {
|
||||
unkStruct2 = &D_80A9E028.unk_02A4[i];
|
||||
if (unkStruct2->unk_2C > 0) {
|
||||
Matrix_SetStateRotationAndTranslation(unkStruct2->unk_04.x, unkStruct2->unk_04.y, unkStruct2->unk_04.z,
|
||||
&unkStruct2->unk_20);
|
||||
Matrix_SetTranslateRotateYXZ(unkStruct2->unk_04.x, unkStruct2->unk_04.y, unkStruct2->unk_04.z,
|
||||
&unkStruct2->unk_20);
|
||||
Matrix_Scale(unkStruct2->unk_00, unkStruct2->unk_00, unkStruct2->unk_00, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
|
||||
@@ -111,7 +111,7 @@ s32 func_80B7EB94(BgIkanaBlock* this, GlobalContext* globalCtx) {
|
||||
sp70.y = this->dyna.actor.world.pos.y + this->unk_170 + 2.0f;
|
||||
sp70.z = this->dyna.actor.world.pos.z;
|
||||
|
||||
Matrix_RotateY(phi_a0, MTXMODE_NEW);
|
||||
Matrix_RotateYS(phi_a0, MTXMODE_NEW);
|
||||
|
||||
if (sp4C) {
|
||||
phi_f12 = 89.0f;
|
||||
@@ -119,7 +119,7 @@ s32 func_80B7EB94(BgIkanaBlock* this, GlobalContext* globalCtx) {
|
||||
phi_f12 = 119.0f;
|
||||
}
|
||||
|
||||
Matrix_GetStateTranslationAndScaledZ(phi_f12, &sp64);
|
||||
Matrix_MultVecZ(phi_f12, &sp64);
|
||||
|
||||
sp64.x += this->dyna.actor.world.pos.x;
|
||||
sp64.y += this->dyna.actor.world.pos.y + this->unk_170 + 2.0f;
|
||||
@@ -137,10 +137,10 @@ void func_80B7ED54(BgIkanaBlock* this) {
|
||||
s32 pad;
|
||||
Vec3f sp18;
|
||||
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslationAndScaledY(30.0f, &sp18);
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultVecY(30.0f, &sp18);
|
||||
this->unk_170 = sp18.y - 30.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,8 +109,8 @@ void func_80BD4720(BgIkanaBombwall* this, GlobalContext* globalCtx) {
|
||||
s16 temp;
|
||||
s16 phi_t0;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_Push();
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
temp_fs0 = 0.0f;
|
||||
phi_fs1 = 0.0f;
|
||||
|
||||
@@ -130,8 +130,8 @@ void func_80BD4720(BgIkanaBombwall* this, GlobalContext* globalCtx) {
|
||||
spBC.y = (Rand_ZeroOne() * 7.0f) - 2.0f;
|
||||
spBC.z = (Rand_ZeroOne() * 4.0f) - 2.0f;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&spC8, &spE0);
|
||||
Matrix_MultiplyVector3fByState(&spBC, &spD4);
|
||||
Matrix_MultVec3f(&spC8, &spE0);
|
||||
Matrix_MultVec3f(&spBC, &spD4);
|
||||
|
||||
spE0.x += this->dyna.actor.world.pos.x;
|
||||
spE0.y += this->dyna.actor.world.pos.y;
|
||||
@@ -161,7 +161,7 @@ void func_80BD4720(BgIkanaBombwall* this, GlobalContext* globalCtx) {
|
||||
-1, OBJECT_IKANA_OBJ, object_ikana_obj_DL_000288);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
#else
|
||||
void func_80BD4720(BgIkanaBombwall* this, GlobalContext* globalCtx);
|
||||
|
||||
@@ -140,8 +140,8 @@ CollisionHeader* D_80B82218[] = { &object_ikana_obj_Colheader_006368, &object_ik
|
||||
void func_80B802E0(BgIkanaRotaryroom* this) {
|
||||
s32 pad;
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
Collider_UpdateSpheres(0, &this->collider);
|
||||
@@ -164,21 +164,21 @@ void func_80B80440(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Vec3f sp50;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Push();
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
if (Flags_GetSwitch(globalCtx, BGIKANAROTARYROOM_GET_7F00(&this->dyna.actor))) {
|
||||
Matrix_InsertTranslation(D_80B82178.x, D_80B82178.y, D_80B82178.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(D_80B82178.x, D_80B82178.y, D_80B82178.z, MTXMODE_APPLY);
|
||||
} else {
|
||||
Matrix_InsertTranslation(D_80B8216C.x, D_80B8216C.y, D_80B8216C.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(D_80B8216C.x, D_80B8216C.y, D_80B8216C.z, MTXMODE_APPLY);
|
||||
}
|
||||
Matrix_GetStateTranslation(&sp50);
|
||||
Matrix_MultZero(&sp50);
|
||||
func_80B80358(&sp50);
|
||||
this->unk_204.unk_00 = Actor_SpawnAsChildAndCutscene(
|
||||
&globalCtx->actorCtx, globalCtx, ACTOR_BG_IKANA_BLOCK, sp50.x, sp50.y, sp50.z, this->dyna.actor.shape.rot.x,
|
||||
this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, -1,
|
||||
ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene), this->dyna.actor.unk20, NULL);
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
void func_80B80550(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
@@ -200,12 +200,12 @@ void func_80B80550(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
actor = globalCtx->actorCtx.actorLists[ACTORCAT_DOOR].first;
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
sp60.x = BINANG_ROT180(this->dyna.actor.home.rot.x);
|
||||
sp60.y = this->dyna.actor.home.rot.y;
|
||||
sp60.z = this->dyna.actor.home.rot.z;
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &sp60);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &sp60);
|
||||
|
||||
while (actor != NULL) {
|
||||
if (actor->id == ACTOR_DOOR_SHUTTER) {
|
||||
@@ -215,24 +215,24 @@ void func_80B80550(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
ptr = &D_80B82184[spC8][i];
|
||||
|
||||
if ((Math3D_Vec3fDistSq(&spB4, &D_80B82184[spC8][i].unk_04) < SQ(250.0f)) &&
|
||||
((ptr->unk_00 ^ spC4) && (ptr->unk_01 == 0U))) {
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(spB4.x, spB4.y, spB4.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(actor->shape.rot.y - this->dyna.actor.home.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(actor->shape.rot.x - this->dyna.actor.home.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(actor->shape.rot.z - this->dyna.actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&actor->world.pos);
|
||||
((ptr->unk_00 ^ spC4) && (ptr->unk_01 == 0))) {
|
||||
Matrix_Push();
|
||||
Matrix_Translate(spB4.x, spB4.y, spB4.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(actor->shape.rot.y - this->dyna.actor.home.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(actor->shape.rot.x - this->dyna.actor.home.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(actor->shape.rot.z - this->dyna.actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&actor->world.pos);
|
||||
func_80B80358(&actor->world.pos);
|
||||
Matrix_CopyCurrentState(&sp68);
|
||||
func_8018219C(&sp68, &actor->shape.rot, 0);
|
||||
Matrix_StatePop();
|
||||
Matrix_Get(&sp68);
|
||||
Matrix_MtxFToYXZRot(&sp68, &actor->shape.rot, false);
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
actor = actor->next;
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
BgIkanaRotaryroomStruct4* func_80B80778(BgIkanaRotaryroom* this, GlobalContext* globalCtx, Actor* arg2) {
|
||||
@@ -246,21 +246,20 @@ BgIkanaRotaryroomStruct4* func_80B80778(BgIkanaRotaryroom* this, GlobalContext*
|
||||
if (1) {}
|
||||
|
||||
if (arg2->id == ACTOR_DOOR_SHUTTER) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_80B82184); i++) {
|
||||
ptr = &D_80B82184[temp_s3][i];
|
||||
if ((ptr->unk_01 == 0) &&
|
||||
(Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot),
|
||||
Matrix_MultiplyVector3fByState(&ptr->unk_04, &sp68),
|
||||
(Math3D_Vec3fDistSq(&arg2->world.pos, &sp68) < SQ(250.0f)))) {
|
||||
(Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot),
|
||||
Matrix_MultVec3f(&ptr->unk_04, &sp68), (Math3D_Vec3fDistSq(&arg2->world.pos, &sp68) < SQ(250.0f)))) {
|
||||
sp58 = ptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
return sp58;
|
||||
}
|
||||
@@ -270,24 +269,24 @@ void func_80B80894(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
Actor* actor = this->unk_204.unk_00;
|
||||
s32 i;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertZRotation_s(-this->dyna.actor.shape.rot.z, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(-this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(-this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(-this->dyna.actor.world.pos.x, -this->dyna.actor.world.pos.y,
|
||||
-this->dyna.actor.world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->dyna.actor.shape.rot.z, MTXMODE_NEW);
|
||||
Matrix_RotateXS(-this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(-this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(-this->dyna.actor.world.pos.x, -this->dyna.actor.world.pos.y, -this->dyna.actor.world.pos.z,
|
||||
MTXMODE_APPLY);
|
||||
|
||||
if (actor != NULL) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_CopyCurrentState(&this->unk_204.unk_04);
|
||||
Matrix_Translate(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Get(&this->unk_204.unk_04);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_248); i++) {
|
||||
@@ -300,15 +299,15 @@ void func_80B80894(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
if (func_80B80778(this, globalCtx, actor) && (i < 2)) {
|
||||
this->unk_248[i].unk_00 = actor;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_CopyCurrentState(&this->unk_248[i].unk_04);
|
||||
Matrix_Translate(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Get(&this->unk_248[i].unk_04);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
i++;
|
||||
}
|
||||
actor = actor->next;
|
||||
@@ -324,15 +323,15 @@ void func_80B80894(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
if ((actor->id == ACTOR_EN_TORCH2) && (actor->update != NULL) && (i < ARRAY_COUNT(this->unk_2D0))) {
|
||||
this->unk_2D0[i].unk_00 = actor;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_CopyCurrentState(&this->unk_2D0[i].unk_04);
|
||||
Matrix_Translate(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Get(&this->unk_2D0[i].unk_04);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
i++;
|
||||
}
|
||||
actor = actor->next;
|
||||
@@ -350,15 +349,15 @@ void func_80B80894(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
this->unk_3E0[i].unk_44 = actor->shape.rot;
|
||||
this->unk_3E0[i].unk_4C = 0.0f;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_CopyCurrentState(&this->unk_3E0[i].unk_04);
|
||||
Matrix_Translate(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Get(&this->unk_3E0[i].unk_04);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
i++;
|
||||
}
|
||||
actor = actor->next;
|
||||
@@ -368,18 +367,18 @@ void func_80B80894(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
if (actor->update != NULL) {
|
||||
this->unk_520.unk_40 = actor->shape.rot;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_CopyCurrentState(&this->unk_520.unk_00);
|
||||
Matrix_Translate(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(actor->shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(actor->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(actor->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Get(&this->unk_520.unk_00);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
void func_80B80C88(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
@@ -392,83 +391,83 @@ void func_80B80C88(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
MtxF sp3C;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Push();
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
|
||||
if (ikanaBlock != NULL) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertMatrix(&this->unk_204.unk_04, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&ikanaBlock->dyna.actor.world.pos);
|
||||
Matrix_Mult(&this->unk_204.unk_04, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&ikanaBlock->dyna.actor.world.pos);
|
||||
func_80B80358(&ikanaBlock->dyna.actor.world.pos);
|
||||
Matrix_CopyCurrentState(&sp3C);
|
||||
func_8018219C(&sp3C, &ikanaBlock->dyna.actor.shape.rot, 0);
|
||||
Matrix_Get(&sp3C);
|
||||
Matrix_MtxFToYXZRot(&sp3C, &ikanaBlock->dyna.actor.shape.rot, false);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_248); i++) {
|
||||
ptr = this->unk_248[i].unk_00;
|
||||
if (ptr != NULL) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertMatrix(&this->unk_248[i].unk_04, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&ptr->world.pos);
|
||||
Matrix_Mult(&this->unk_248[i].unk_04, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&ptr->world.pos);
|
||||
func_80B80358(&ptr->world.pos);
|
||||
Matrix_CopyCurrentState(&sp3C);
|
||||
func_8018219C(&sp3C, &ptr->shape.rot, 0);
|
||||
Matrix_Get(&sp3C);
|
||||
Matrix_MtxFToYXZRot(&sp3C, &ptr->shape.rot, false);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++) {
|
||||
ptr2 = this->unk_2D0[i].unk_00;
|
||||
if (ptr2 != NULL) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertMatrix(&this->unk_2D0[i].unk_04, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&ptr2->world.pos);
|
||||
Matrix_Mult(&this->unk_2D0[i].unk_04, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&ptr2->world.pos);
|
||||
func_80B80358(&ptr2->world.pos);
|
||||
Matrix_CopyCurrentState(&sp3C);
|
||||
func_8018219C(&sp3C, &ptr2->shape.rot, 0);
|
||||
Matrix_Get(&sp3C);
|
||||
Matrix_MtxFToYXZRot(&sp3C, &ptr2->shape.rot, false);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
|
||||
ptr3 = this->unk_3E0[i].unk_00;
|
||||
if (ptr3 != NULL) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertMatrix(&this->unk_3E0[i].unk_04, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&ptr3->world.pos);
|
||||
Matrix_Mult(&this->unk_3E0[i].unk_04, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&ptr3->world.pos);
|
||||
func_80B80358(&ptr3->world.pos);
|
||||
Matrix_CopyCurrentState(&sp3C);
|
||||
func_8018219C(&sp3C, &ptr3->shape.rot, 0);
|
||||
Matrix_Get(&sp3C);
|
||||
Matrix_MtxFToYXZRot(&sp3C, &ptr3->shape.rot, false);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
|
||||
player = GET_PLAYER(globalCtx);
|
||||
if (player != NULL) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_InsertMatrix(&this->unk_520.unk_00, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&player->actor.world.pos);
|
||||
Matrix_Mult(&this->unk_520.unk_00, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&player->actor.world.pos);
|
||||
Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos);
|
||||
func_80B80358(&player->actor.world.pos);
|
||||
Matrix_CopyCurrentState(&sp3C);
|
||||
func_8018219C(&sp3C, &player->actor.shape.rot, 0);
|
||||
Matrix_Get(&sp3C);
|
||||
Matrix_MtxFToYXZRot(&sp3C, &player->actor.shape.rot, false);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
player->actor.freezeTimer = 2;
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
s32 func_80B80F08(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
@@ -479,18 +478,18 @@ s32 func_80B80F08(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
s32 sp24 = false;
|
||||
|
||||
if (ikanaBlock != NULL) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_InsertTranslation(D_80B82178.x, D_80B82178.y, D_80B82178.z, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&sp34);
|
||||
Matrix_SetStateRotationAndTranslation(ikanaBlock->dyna.actor.world.pos.x,
|
||||
ikanaBlock->dyna.actor.world.pos.y + ikanaBlock->unk_170,
|
||||
ikanaBlock->dyna.actor.world.pos.z, &ikanaBlock->dyna.actor.shape.rot);
|
||||
Matrix_GetStateTranslation(&sp28);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Translate(D_80B82178.x, D_80B82178.y, D_80B82178.z, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&sp34);
|
||||
Matrix_SetTranslateRotateYXZ(ikanaBlock->dyna.actor.world.pos.x,
|
||||
ikanaBlock->dyna.actor.world.pos.y + ikanaBlock->unk_170,
|
||||
ikanaBlock->dyna.actor.world.pos.z, &ikanaBlock->dyna.actor.shape.rot);
|
||||
Matrix_MultZero(&sp28);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (Math3D_Vec3fDistSq(&sp34, &sp28) < 3.0f) {
|
||||
if (!Flags_GetSwitch(globalCtx, BGIKANAROTARYROOM_GET_7F00(&this->dyna.actor))) {
|
||||
@@ -604,14 +603,14 @@ void func_80B81234(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
ptr->unk_4C.y += ptr->unk_48;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
Matrix_RotateY(player->actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(player->actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(player->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslationAndScaledY(sp44, &sp4C);
|
||||
Matrix_RotateYS(player->actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(player->actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(player->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultVecY(sp44, &sp4C);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
temp_f0 = BgCheck_EntityRaycastFloor5_2(globalCtx, &globalCtx->colCtx, &sp40, &sp3C, NULL, &sp58);
|
||||
if (ptr->unk_4C.y <= temp_f0) {
|
||||
@@ -666,15 +665,15 @@ void func_80B81570(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
s32 pad2;
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_Push();
|
||||
Matrix_RotateYS(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_80B821C4); i++) {
|
||||
sp64.x = D_80B821C4[i].x;
|
||||
sp64.y = D_80B821C4[i].y;
|
||||
sp64.z = D_80B821C4[i].z;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&sp64, &sp70);
|
||||
Matrix_MultVec3f(&sp64, &sp70);
|
||||
|
||||
sp70.x += this->dyna.actor.world.pos.x;
|
||||
sp70.y += this->dyna.actor.world.pos.y;
|
||||
@@ -683,7 +682,7 @@ void func_80B81570(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_WATER_EFFECT, sp70.x, sp70.y, sp70.z, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
s32 func_80B816A4(BgIkanaRotaryroom* this) {
|
||||
|
||||
@@ -142,11 +142,11 @@ void BgKin2Fence_SpawnEyeSparkles(BgKin2Fence* this, GlobalContext* globalCtx, s
|
||||
Vec3f sp58;
|
||||
s32 pad[2];
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
Matrix_MultiplyVector3fByState(&eyeSparkleSpawnPositions[mask][i], &sp58);
|
||||
Matrix_MultVec3f(&eyeSparkleSpawnPositions[mask][i], &sp58);
|
||||
EffectSsKirakira_SpawnDispersed(globalCtx, &sp58, &gZeroVec3f, &gZeroVec3f, &primColor, &envColor, 6000, -10);
|
||||
}
|
||||
}
|
||||
@@ -160,8 +160,8 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_kin2_obj_Colheader_000908);
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
|
||||
@@ -77,22 +77,22 @@ s32 func_80B6FB30(BgKin2Shelf* this, GlobalContext* globalCtx) {
|
||||
|
||||
spA4 = D_80B70750[temp_v1] + ((this->dyna.pushForce < 0.0f) ? 28.0f : -2.0f) + D_80B70768[temp_v1];
|
||||
|
||||
Matrix_InsertTranslation(0.0f, 10.0f, D_80B70760[temp_v1], MTXMODE_NEW);
|
||||
Matrix_RotateY(spA2, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 10.0f, D_80B70760[temp_v1], MTXMODE_NEW);
|
||||
Matrix_RotateYS(spA2, MTXMODE_APPLY);
|
||||
|
||||
sp58.x = 0.0f;
|
||||
sp58.y = 0.0f;
|
||||
sp58.z = 0.0f;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&sp58, &sp94);
|
||||
Matrix_MultVec3f(&sp58, &sp94);
|
||||
|
||||
sp58.z = spA4;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&sp58, &sp88);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_MultiplyVector3fByState(&sp94, &sp7C);
|
||||
Matrix_MultiplyVector3fByState(&sp88, &sp70);
|
||||
Matrix_MultVec3f(&sp58, &sp88);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_MultVec3f(&sp94, &sp7C);
|
||||
Matrix_MultVec3f(&sp88, &sp70);
|
||||
|
||||
return BgCheck_EntityLineTest3(&globalCtx->colCtx, &sp7C, &sp70, &sp64, &sp54, true, false, false, true, &sp50,
|
||||
&this->dyna.actor, 0.0f);
|
||||
@@ -119,22 +119,22 @@ s32 func_80B6FCA4(BgKin2Shelf* this, GlobalContext* globalCtx) {
|
||||
|
||||
spA0 = D_80B70758[0] + ((this->dyna.pushForce < 0.0f) ? 28.0f : -2.0f) + D_80B70770[0];
|
||||
|
||||
Matrix_InsertTranslation(0.0f, 10.0f, *D_80B70760, MTXMODE_NEW);
|
||||
Matrix_RotateY(sp9E, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 10.0f, *D_80B70760, MTXMODE_NEW);
|
||||
Matrix_RotateYS(sp9E, MTXMODE_APPLY);
|
||||
|
||||
sp54.x = 0.0f;
|
||||
sp54.y = 0.0f;
|
||||
sp54.z = 0.0f;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&sp54, &sp90);
|
||||
Matrix_MultVec3f(&sp54, &sp90);
|
||||
|
||||
sp54.z = spA0;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&sp54, &sp84);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_MultiplyVector3fByState(&sp90, &sp78);
|
||||
Matrix_MultiplyVector3fByState(&sp84, &sp6C);
|
||||
Matrix_MultVec3f(&sp54, &sp84);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_MultVec3f(&sp90, &sp78);
|
||||
Matrix_MultVec3f(&sp84, &sp6C);
|
||||
|
||||
return BgCheck_EntityLineTest3(&globalCtx->colCtx, &sp78, &sp6C, &sp60, &sp50, true, false, false, true, &sp4C,
|
||||
&this->dyna.actor, 0.0f);
|
||||
|
||||
@@ -391,14 +391,14 @@ void BgNumaHana_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
innerPetalPosRot = &this->innerPetalPosRot[i];
|
||||
outerPetalPosRot = &this->outerPetalPosRot[i];
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(innerPetalPosRot->pos.x, innerPetalPosRot->pos.y, innerPetalPosRot->pos.z,
|
||||
&innerPetalPosRot->rot);
|
||||
Matrix_SetTranslateRotateYXZ(innerPetalPosRot->pos.x, innerPetalPosRot->pos.y, innerPetalPosRot->pos.z,
|
||||
&innerPetalPosRot->rot);
|
||||
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gWoodenFlowerInnerPetalDL);
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(outerPetalPosRot->pos.x, outerPetalPosRot->pos.y, outerPetalPosRot->pos.z,
|
||||
&outerPetalPosRot->rot);
|
||||
Matrix_SetTranslateRotateYXZ(outerPetalPosRot->pos.x, outerPetalPosRot->pos.y, outerPetalPosRot->pos.z,
|
||||
&outerPetalPosRot->rot);
|
||||
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gWoodenFlowerOuterPetalDL);
|
||||
@@ -406,8 +406,8 @@ void BgNumaHana_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
|
||||
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_SYOKUDAI);
|
||||
if ((objectIndex >= 0) && (Object_IsLoaded(&globalCtx->objectCtx, objectIndex))) {
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 64.5f,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 64.5f,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(1.5f, 1.5f, 1.5f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[objectIndex].segment);
|
||||
|
||||
@@ -186,12 +186,12 @@ void func_809CE068(BgSpdweb* this) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
|
||||
for (i = 0; i < this->collider.count; i++) {
|
||||
for (j = 0; j < ARRAY_COUNT(sp64); j++) {
|
||||
Matrix_MultiplyVector3fByState(this->collider.elements[i].dim.vtx + j, &sp64[j]);
|
||||
Matrix_MultVec3f(this->collider.elements[i].dim.vtx + j, &sp64[j]);
|
||||
}
|
||||
Collider_SetTrisVertices(&this->collider, i, &sp64[0], &sp64[1], &sp64[2]);
|
||||
}
|
||||
@@ -513,7 +513,7 @@ void BgSpdweb_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPMatrix(&gfx[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(&gfx[2], object_spdweb_DL_000060);
|
||||
} else {
|
||||
Matrix_InsertTranslation(0.0f, (thisx->home.pos.y - thisx->world.pos.y) * 10.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, (thisx->home.pos.y - thisx->world.pos.y) * 10.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, ((thisx->home.pos.y - thisx->world.pos.y) + 10.0f) * 0.1f, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(&gfx[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -912,8 +912,8 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) {
|
||||
this->unk_0152 = 15;
|
||||
if ((s16)(BREG(71) + 140) < this->unk_0146[1]) {
|
||||
if (this->unk_0146[0] == 0) {
|
||||
Matrix_RotateY(Math_Atan2S(-player->actor.world.pos.x, -player->actor.world.pos.z), MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(1500.0f * D_809DF5B0, &spA4);
|
||||
Matrix_RotateYS(Math_Atan2S(-player->actor.world.pos.x, -player->actor.world.pos.z), MTXMODE_NEW);
|
||||
Matrix_MultVecZ(1500.0f * D_809DF5B0, &spA4);
|
||||
this->unk_0146[0] = 50;
|
||||
this->unk_01B0.x = player->actor.world.pos.x + spA4.x;
|
||||
this->unk_01B0.y = randPlusMinusPoint5Scaled(500.0f * D_809DF5B0) + (600.0f * D_809DF5B0);
|
||||
@@ -1023,15 +1023,14 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) {
|
||||
sp9C = Rand_ZeroFloat(M_PI);
|
||||
|
||||
for (i = 0; i < 15; i++) {
|
||||
Matrix_InsertYRotation_f(((2.0f * (i * M_PI)) / 15.0f) + sp9C, MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ((10 - this->unk_0146[0]) * (D_809DF5B0 * 300.0f) * 0.1f,
|
||||
&sp90);
|
||||
Matrix_RotateYF(((2.0f * (i * M_PI)) / 15.0f) + sp9C, MTXMODE_NEW);
|
||||
Matrix_MultVecZ((10 - this->unk_0146[0]) * (D_809DF5B0 * 300.0f) * 0.1f, &sp90);
|
||||
spD0.x = this->unk_0170.x + sp90.x;
|
||||
spD0.y = this->unk_0170.y + (1000.0f * D_809DF5B0);
|
||||
spD0.z = this->unk_0170.z + sp90.z;
|
||||
if (BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &sp8C, &sp88, &spD0) != BGCHECK_Y_MIN) {
|
||||
spA0 = BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &sp8C, &spD0);
|
||||
Matrix_GetStateTranslationAndScaledZ(5.0f * D_809DF5B0, &sp70);
|
||||
Matrix_MultVecZ(5.0f * D_809DF5B0, &sp70);
|
||||
sp70.y = 2.0f * D_809DF5B0;
|
||||
sp64.y = 0.3f * D_809DF5B0;
|
||||
sp64.z = 0.0f;
|
||||
@@ -1376,14 +1375,14 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
}
|
||||
|
||||
idx = (this->unk_014E + 196) % ARRAY_COUNT(this->unk_01BC);
|
||||
Matrix_InsertTranslation(this->unk_01BC[idx].x, this->unk_01BC[idx].y, this->unk_01BC[idx].z, MTXMODE_NEW);
|
||||
Matrix_InsertYRotation_f(this->unk_0B1C[idx].y + spA8, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(spAC - this->unk_0B1C[idx].x);
|
||||
Matrix_Translate(this->unk_01BC[idx].x, this->unk_01BC[idx].y, this->unk_01BC[idx].z, MTXMODE_NEW);
|
||||
Matrix_RotateYF(this->unk_0B1C[idx].y + spA8, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(spAC - this->unk_0B1C[idx].x);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 250.0f, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslationAndScaledZ(150.0f, &this->unk_147C[0]);
|
||||
Matrix_Translate(0.0f, 0.0f, 250.0f, MTXMODE_APPLY);
|
||||
Matrix_MultVecZ(150.0f, &this->unk_147C[0]);
|
||||
this->unk_0188 = this->unk_017C;
|
||||
Matrix_GetStateTranslationAndScaledZ(300.0f, &this->unk_017C);
|
||||
Matrix_MultVecZ(300.0f, &this->unk_017C);
|
||||
Math_Vec3f_Copy(&this->actor.focus.pos, &this->unk_017C);
|
||||
|
||||
if ((this->unk_0156 & 1) && (this->unk_0158 == 0)) {
|
||||
@@ -1407,14 +1406,13 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
spA0 = spA8;
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(this->unk_01BC[phi_v0].x, this->unk_01BC[phi_v0].y, this->unk_01BC[phi_v0].z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertYRotation_f(this->unk_0B1C[phi_v0].y + spA0, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(spA4 - this->unk_0B1C[phi_v0].x);
|
||||
Matrix_InsertZRotation_f(this->unk_0B1C[phi_v0].z, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->unk_01BC[phi_v0].x, this->unk_01BC[phi_v0].y, this->unk_01BC[phi_v0].z, MTXMODE_NEW);
|
||||
Matrix_RotateYF(this->unk_0B1C[phi_v0].y + spA0, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(spA4 - this->unk_0B1C[phi_v0].x);
|
||||
Matrix_RotateZF(this->unk_0B1C[phi_v0].z, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_InsertYRotation_f(M_PI / 2, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(-(M_PI / 2));
|
||||
Matrix_RotateYF(M_PI / 2, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(-(M_PI / 2));
|
||||
Matrix_ToMtx(mtxIter);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, mtxIter, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -1436,13 +1434,13 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
phi_f12 = 200.0f;
|
||||
}
|
||||
|
||||
Matrix_GetStateTranslationAndScaledX(phi_f12, &this->unk_147C[i + 1]);
|
||||
Matrix_MultVecX(phi_f12, &this->unk_147C[i + 1]);
|
||||
|
||||
if (i == 21) {
|
||||
Actor* child = this->actor.child;
|
||||
|
||||
if (child != NULL) {
|
||||
Matrix_GetStateTranslationAndScaledX(500.0f, &this->actor.child->world.pos);
|
||||
Matrix_MultVecX(500.0f, &this->actor.child->world.pos);
|
||||
}
|
||||
|
||||
func_809DA50C(1, &this->colliderSphere2, &this->unk_147C[i + 1]);
|
||||
@@ -1543,8 +1541,8 @@ void func_809DD2F8(GlobalContext* globalCtx) {
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, effect->unk_26 + (i * 3),
|
||||
(effect->unk_26 + (i * 3)) * 5, 32, 64, 1, 0, 0, 32, 32));
|
||||
|
||||
Matrix_InsertTranslation(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(effect->unk_34 * D_809DF5B0, effect->unk_34 * D_809DF5B0, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
@@ -1562,9 +1560,9 @@ void func_809DD2F8(GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x01, 100, 100, 120, 255);
|
||||
flag++;
|
||||
}
|
||||
Matrix_InsertTranslation(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(effect->unk_30, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(effect->unk_2E, MTXMODE_APPLY);
|
||||
Matrix_Translate(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(effect->unk_30, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(effect->unk_2E, MTXMODE_APPLY);
|
||||
Matrix_Scale(effect->unk_34 * D_809DF5B0, effect->unk_34 * D_809DF5B0, effect->unk_34 * D_809DF5B0,
|
||||
MTXMODE_APPLY);
|
||||
|
||||
@@ -1584,8 +1582,8 @@ void func_809DD2F8(GlobalContext* globalCtx) {
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, (u8)effect->unk_2C);
|
||||
|
||||
Matrix_InsertTranslation(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(effect->unk_34 * D_809DF5B0, effect->unk_34 * D_809DF5B0, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
@@ -1608,8 +1606,8 @@ void func_809DD2F8(GlobalContext* globalCtx) {
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, effect->unk_26 + (i * 3),
|
||||
(effect->unk_26 + (i * 3)) * 5, 32, 64, 1, 0, 0, 32, 32));
|
||||
|
||||
Matrix_InsertTranslation(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(effect->unk_34 * D_809DF5B0, effect->unk_34 * D_809DF5B0, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
@@ -2021,8 +2019,8 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((this->unk_1D18 != 0) && (this->unk_1D22 != 0)) {
|
||||
Matrix_RotateY(player->actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(this->unk_1D64, &sp58);
|
||||
Matrix_RotateYS(player->actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_MultVecZ(this->unk_1D64, &sp58);
|
||||
|
||||
this->unk_1D24.x = player->actor.world.pos.x + sp58.x;
|
||||
this->unk_1D24.y = player->actor.world.pos.y + sp58.y + this->unk_1D68;
|
||||
@@ -2033,8 +2031,8 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) {
|
||||
this->unk_1D30.z = player->actor.world.pos.z;
|
||||
|
||||
this->unk_1D54 = Math_SinS(this->unk_1D14 * 1512) * this->unk_1D58;
|
||||
Matrix_InsertZRotation_f(this->unk_1D54, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslationAndScaledY(1.0f, &this->unk_1D3C);
|
||||
Matrix_RotateZF(this->unk_1D54, MTXMODE_APPLY);
|
||||
Matrix_MultVecY(1.0f, &this->unk_1D3C);
|
||||
Play_CameraSetAtEyeUp(globalCtx, this->unk_1D22, &this->unk_1D30, &this->unk_1D24, &this->unk_1D3C);
|
||||
ShrinkWindow_SetLetterboxTarget(27);
|
||||
}
|
||||
@@ -2084,9 +2082,8 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
this->unk_0150 += 0x4000;
|
||||
sp58 = (Math_SinS(this->unk_0150) * (BREG(19) + 5)) * 0.1f;
|
||||
Matrix_InsertZRotation_f(Math_SinS(this->unk_1D1C * 0x3000) * ((KREG(28) * 0.001f) + 0.017f),
|
||||
MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledY(1.0f, &this->unk_1D3C);
|
||||
Matrix_RotateZF(Math_SinS(this->unk_1D1C * 0x3000) * ((KREG(28) * 0.001f) + 0.017f), MTXMODE_NEW);
|
||||
Matrix_MultVecY(1.0f, &this->unk_1D3C);
|
||||
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
|
||||
}
|
||||
|
||||
|
||||
@@ -491,10 +491,10 @@ void Boss03_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
f32 rand;
|
||||
|
||||
rand = Boss03_RandZeroOne();
|
||||
Matrix_InsertYRotation_f((rand * M_PI * 0.2f) + ((2.0f * M_PI / 5.0f) * i), MTXMODE_NEW);
|
||||
Matrix_RotateYF((rand * M_PI * 0.2f) + ((2.0f * M_PI / 5.0f) * i), MTXMODE_NEW);
|
||||
|
||||
rand = Boss03_RandZeroOne();
|
||||
Matrix_GetStateTranslationAndScaledZ((rand * 800.0f) + 400.0f, &sp70);
|
||||
Matrix_MultVecZ((rand * 800.0f) + 400.0f, &sp70);
|
||||
|
||||
rand = Boss03_RandZeroOne();
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_03, sp70.x, sp70.y, sp70.z, 0, rand * 0x10000, 0,
|
||||
@@ -574,8 +574,8 @@ void func_809E34B8(Boss03* this, GlobalContext* globalCtx) {
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
|
||||
xDiff = this->unk_268.x - this->actor.world.pos.x;
|
||||
yDiff = this->unk_268.y - this->actor.world.pos.y;
|
||||
@@ -589,10 +589,10 @@ void func_809E34B8(Boss03* this, GlobalContext* globalCtx) {
|
||||
|
||||
Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100);
|
||||
Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C);
|
||||
Math_ApproachF(&this->unk_260, __sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
|
||||
if ((this->workTimer[WORK_TIMER_UNK2_A] == 0) && (this->actor.bgCheckFlags & 8)) {
|
||||
Matrix_GetStateTranslationAndScaledZ(-500.0f, &this->unk_268);
|
||||
Matrix_MultVecZ(-500.0f, &this->unk_268);
|
||||
this->unk_268.y = Rand_ZeroFloat(100.0f) + 150.0f;
|
||||
this->workTimer[WORK_TIMER_UNK2_A] = 60;
|
||||
this->workTimer[WORK_TIMER_UNK0_A] = Rand_ZeroFloat(60.0f) + 60.0f;
|
||||
@@ -677,7 +677,7 @@ void Boss03_ChasePlayer(Boss03* this, GlobalContext* globalCtx) {
|
||||
|
||||
Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100);
|
||||
Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C);
|
||||
Math_ApproachF(&this->unk_260, __sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Actor_MoveWithoutGravityReverse(&this->actor);
|
||||
|
||||
Math_ApproachS(&this->actor.shape.rot.x, this->actor.world.rot.x, 2, this->unk_274 * 2);
|
||||
@@ -706,10 +706,9 @@ void Boss03_ChasePlayer(Boss03* this, GlobalContext* globalCtx) {
|
||||
sp44 = 100.0f;
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslationAndScaledZ(sp44, &sp50);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_MultVecZ(sp44, &sp50);
|
||||
|
||||
xDiff = sp50.x - player->actor.world.pos.x;
|
||||
zDiff = sp50.z - player->actor.world.pos.z;
|
||||
@@ -774,7 +773,7 @@ void Boss03_CatchPlayer(Boss03* this, GlobalContext* globalCtx) {
|
||||
5, 0x100);
|
||||
Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100);
|
||||
Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C);
|
||||
Math_ApproachF(&this->unk_260, __sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Actor_MoveWithoutGravityReverse(&this->actor);
|
||||
Math_ApproachS(&this->actor.shape.rot.x, this->actor.world.rot.x, 2, this->unk_274 * 2);
|
||||
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, this->unk_274 * 2);
|
||||
@@ -834,12 +833,12 @@ void Boss03_SetupChewPlayer(Boss03* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc = Boss03_ChewPlayer;
|
||||
|
||||
pitchAngle = Math_FAtan2F(this->actor.world.pos.z, this->actor.world.pos.x);
|
||||
Matrix_RotateY(pitchAngle, MTXMODE_NEW);
|
||||
Matrix_RotateYS(pitchAngle, MTXMODE_NEW);
|
||||
|
||||
out.x = 0.0f;
|
||||
out.y = 200.0f;
|
||||
out.z = 700.0f;
|
||||
Matrix_MultiplyVector3fByState(&out, &this->unk_268);
|
||||
Matrix_MultVec3f(&out, &this->unk_268);
|
||||
|
||||
this->unk_276 = 0x800;
|
||||
this->unk_242 = 0;
|
||||
@@ -864,8 +863,8 @@ void Boss03_ChewPlayer(Boss03* this, GlobalContext* globalCtx) {
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
|
||||
xDiff = this->unk_268.x - this->actor.world.pos.x;
|
||||
yDiff = this->unk_268.y - this->actor.world.pos.y;
|
||||
@@ -877,7 +876,7 @@ void Boss03_ChewPlayer(Boss03* this, GlobalContext* globalCtx) {
|
||||
-0.5f,
|
||||
5, 0x100);
|
||||
Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100);
|
||||
Math_ApproachF(&this->unk_260, __sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
|
||||
switch (this->unk_242) {
|
||||
case 0:
|
||||
@@ -1041,7 +1040,7 @@ void Boss03_Charge(Boss03* this, GlobalContext* globalCtx) {
|
||||
this->actor.shape.rot = this->actor.world.rot;
|
||||
|
||||
Math_ApproachF(&this->actor.speedXZ, 25.0f, 1.0f, 3.0f);
|
||||
Math_ApproachF(&this->unk_260, __sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
|
||||
Actor_MoveWithoutGravityReverse(&this->actor);
|
||||
|
||||
if (this->actor.speedXZ >= 20.0f) {
|
||||
@@ -1394,12 +1393,11 @@ void Boss03_IntroCutscene(Boss03* this, GlobalContext* globalCtx) {
|
||||
phi_f2 = CLAMP_MAX(phi_f2, 0.12f);
|
||||
|
||||
sp5C = Math_SinS(this->unk_240 * sp5A) * phi_f2;
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertYRotation_f(sp5C, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslationAndScaledZ(100.0f, &this->csCamAt);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(sp5C, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_MultVecZ(100.0f, &this->csCamAt);
|
||||
|
||||
this->csCamEye = this->actor.world.pos;
|
||||
|
||||
@@ -1491,8 +1489,8 @@ void Boss03_DeathCutscene(Boss03* this, GlobalContext* globalCtx) {
|
||||
this->csCamTargetAt.z = this->actor.world.pos.z;
|
||||
|
||||
this->unk_568 += this->unk_56C;
|
||||
Matrix_InsertYRotation_f(this->unk_568, MTXMODE_NEW);
|
||||
Matrix_MultiplyVector3fByState(&sp90, &this->csCamTargetEye);
|
||||
Matrix_RotateYF(this->unk_568, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&sp90, &this->csCamTargetEye);
|
||||
|
||||
this->csCamTargetEye.x += this->actor.world.pos.x;
|
||||
this->csCamTargetEye.y += this->waterHeight;
|
||||
@@ -1517,8 +1515,8 @@ void Boss03_DeathCutscene(Boss03* this, GlobalContext* globalCtx) {
|
||||
Math_ApproachF(&this->actor.world.pos.y, Math_SinS(this->unk_240 * 0x1000) * 80.0f + this->waterHeight,
|
||||
1.0f, 10.0f);
|
||||
this->actor.shape.rot.z += 0x100;
|
||||
Matrix_RotateY(this->unk_2BE, MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(500.0f, &sp84);
|
||||
Matrix_RotateYS(this->unk_2BE, MTXMODE_NEW);
|
||||
Matrix_MultVecZ(500.0f, &sp84);
|
||||
Math_ApproachF(&this->actor.world.pos.x, sp84.x, 0.1f, 5.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.z, sp84.z, 0.1f, 5.0f);
|
||||
|
||||
@@ -1692,10 +1690,10 @@ void Boss03_SpawnSmallFishesCutscene(Boss03* this, GlobalContext* globalCtx) {
|
||||
|
||||
player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.world.rot.y + 0x8000;
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.shape.rot.y + this->unk_2BE, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslationAndScaledZ(340.0f, &this->csCamEye);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y + this->unk_2BE, MTXMODE_APPLY);
|
||||
Matrix_MultVecZ(340.0f, &this->csCamEye);
|
||||
|
||||
this->csCamAt.x = this->actor.world.pos.x;
|
||||
this->csCamAt.y = this->actor.world.pos.y;
|
||||
@@ -2065,8 +2063,8 @@ void Boss03_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
if (this->unk_290 != 0) {
|
||||
this->unk_294 += 0.1f;
|
||||
this->unk_298 += 0.12f;
|
||||
this->leftFinYRot = __sinf(this->unk_294) * 1280.0f;
|
||||
this->rightFinYRot = __sinf(this->unk_298) * 1280.0f;
|
||||
this->leftFinYRot = sinf(this->unk_294) * 1280.0f;
|
||||
this->rightFinYRot = sinf(this->unk_298) * 1280.0f;
|
||||
} else {
|
||||
Math_ApproachS(&this->rightFinYRot, 0, 0xA, 0x100);
|
||||
Math_ApproachS(&this->leftFinYRot, 0, 0xA, 0x100);
|
||||
@@ -2132,8 +2130,8 @@ void Boss03_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
yRot = 0.0f;
|
||||
|
||||
for (j = 0, i = 0; i < 20; j++) {
|
||||
Matrix_InsertYRotation_f(yRot, MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(Rand_ZeroFloat(60.000004f) + 312.0f, &dropletPos);
|
||||
Matrix_RotateYF(yRot, MTXMODE_NEW);
|
||||
Matrix_MultVecZ(Rand_ZeroFloat(60.000004f) + 312.0f, &dropletPos);
|
||||
dropletPos.x += this->unk_284 + randPlusMinusPoint5Scaled(40.0f);
|
||||
dropletPos.y = PLATFORM_HEIGHT;
|
||||
dropletPos.z += this->unk_28C + randPlusMinusPoint5Scaled(40.0f);
|
||||
@@ -2236,12 +2234,12 @@ void Boss03_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (limbIndex == GYORG_LIMB_HEAD) {
|
||||
Matrix_MultiplyVector3fByState(&D_809E9148, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_809E9148, &this->actor.focus.pos);
|
||||
}
|
||||
|
||||
sphereElementIndex = sGyorgSphElementIndices[limbIndex];
|
||||
if (sphereElementIndex >= 0) {
|
||||
Matrix_MultiplyVector3fByState(&D_809E9154[sphereElementIndex], &spherePos);
|
||||
Matrix_MultVec3f(&D_809E9154[sphereElementIndex], &spherePos);
|
||||
|
||||
if (sphereElementIndex < 2) {
|
||||
if ((this->actionFunc == Boss03_Stunned) && (this->waterHeight < player->actor.world.pos.y)) {
|
||||
@@ -2258,9 +2256,9 @@ void Boss03_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
MtxF mf;
|
||||
|
||||
D_809E91B4.x = this->unk_2C4 + 300.0f;
|
||||
Matrix_MultiplyVector3fByState(&D_809E91B4, &this->insideJawPos);
|
||||
Matrix_CopyCurrentState(&mf);
|
||||
func_8018219C(&mf, &this->unk_2A2, 0);
|
||||
Matrix_MultVec3f(&D_809E91B4, &this->insideJawPos);
|
||||
Matrix_Get(&mf);
|
||||
Matrix_MtxFToYXZRot(&mf, &this->unk_2A2, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2276,8 +2274,8 @@ void Boss03_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099);
|
||||
}
|
||||
|
||||
Matrix_InsertYRotation_f(this->unk_260, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -600.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(this->unk_260, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, -600.0f, 0.0f, MTXMODE_APPLY);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, Boss03_OverrideLimbDraw, Boss03_PostLimbDraw, &this->actor);
|
||||
POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
|
||||
@@ -2346,11 +2344,11 @@ void Boss03_UpdateEffects(GlobalContext* globalCtx) {
|
||||
eff->alphaDelta = Rand_ZeroFloat(4.0f) + 5.0f;
|
||||
|
||||
for (j = 0; j < 4; j++) {
|
||||
Matrix_InsertYRotation_f((2.0f * (j * M_PI)) / 6.0f, 0);
|
||||
Matrix_RotateYF((2.0f * (j * M_PI)) / 6.0f, MTXMODE_NEW);
|
||||
sp94.x = 0.0f;
|
||||
sp94.y = Rand_ZeroFloat(4.0f) + 2.0f;
|
||||
sp94.z = Rand_ZeroFloat(1.5f) + 1.5f;
|
||||
Matrix_MultiplyVector3fByState(&sp94, &velocity);
|
||||
Matrix_MultVec3f(&sp94, &velocity);
|
||||
Boss03_SpawnEffectSplash(globalCtx, &eff->pos, &velocity);
|
||||
}
|
||||
}
|
||||
@@ -2413,9 +2411,9 @@ void Boss03_DrawEffects(GlobalContext* globalCtx) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(eff->unk_34.x, eff->unk_34.x, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -2444,18 +2442,17 @@ void Boss03_DrawEffects(GlobalContext* globalCtx) {
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (u8)eff->unk_40, (u8)((((void)0, eff->unk_40) + 55.0f)), 225, 150);
|
||||
|
||||
Matrix_InsertTranslation(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||
|
||||
if (eff->type == GYORG_EFFECT_DROPLET) {
|
||||
Matrix_InsertYRotation_f(Camera_GetInputDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) *
|
||||
(M_PI / 0x8000),
|
||||
MTXMODE_APPLY);
|
||||
Matrix_RotateYF(Camera_GetInputDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) * (M_PI / 0x8000),
|
||||
MTXMODE_APPLY);
|
||||
} else { // GYORG_EFFECT_SPLASH
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
}
|
||||
|
||||
Matrix_Scale(eff->unk_34.x, eff->unk_34.y, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(eff->unk_34.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(eff->unk_34.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_0042B0);
|
||||
@@ -2481,10 +2478,10 @@ void Boss03_DrawEffects(GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s16)eff->unk_40, ((void)0, ((s16)eff->unk_40) + 55), 225,
|
||||
eff->alpha);
|
||||
|
||||
Matrix_InsertTranslation(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||
|
||||
Matrix_Scale(eff->unk_34.x, 1.0f, eff->unk_34.x, MTXMODE_APPLY);
|
||||
Matrix_InsertYRotation_f(eff->unk_34.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(eff->unk_34.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_0042F8);
|
||||
@@ -2610,27 +2607,27 @@ void Boss03_SeaweedDraw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(0x4000, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(0x4000, MTXMODE_APPLY);
|
||||
// The indices looks a bit random...
|
||||
Matrix_RotateY(this->jointTable[5].x * -5.0f * 0.1f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->jointTable[3].y * -5.0f * 0.1f, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->jointTable[2].z * 6.0f * 0.1f, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->jointTable[5].x * -5.0f * 0.1f, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->jointTable[3].y * -5.0f * 0.1f, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->jointTable[2].z * 6.0f * 0.1f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sGyorgSeaweedDLs); i++, mtx++) {
|
||||
Matrix_RotateY(this->jointTable[i].x + this->morphTable[i].x, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->jointTable[i].y + this->morphTable[i].y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->jointTable[i].z + this->morphTable[i].z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->jointTable[i].x + this->morphTable[i].x, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->jointTable[i].y + this->morphTable[i].y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->jointTable[i].z + this->morphTable[i].z, MTXMODE_APPLY);
|
||||
|
||||
Matrix_ToMtx(mtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, sGyorgSeaweedDLs[i]);
|
||||
|
||||
Matrix_GetStateTranslation(&this->seaweedSegmentPositions[i]);
|
||||
Matrix_InsertTranslation(4000.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&this->seaweedSegmentPositions[i]);
|
||||
Matrix_Translate(4000.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -214,8 +214,8 @@ void Boss04_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
this->unk_6F6 = 82;
|
||||
phi_s0_2 = 0;
|
||||
for (i = 0; i < 82; i++) {
|
||||
Matrix_RotateY(phi_s0_2, MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(phi_f20, &sp90);
|
||||
Matrix_RotateYS(phi_s0_2, MTXMODE_NEW);
|
||||
Matrix_MultVecZ(phi_f20, &sp90);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_TANRON2, this->unk_6E8 + sp90.x,
|
||||
phi_f24, this->unk_6F0 + sp90.z, 0, 0, 0, i);
|
||||
phi_f20 += 2.5f;
|
||||
@@ -245,7 +245,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
|
||||
this->unk_1FE = 15;
|
||||
if ((this->unk_708 != 0) && (this->unk_708 < 10)) {
|
||||
this->actor.world.pos.y = (Math_SinS(this->unk_1F4 * 512) * 10.0f) + (this->actor.floorHeight + 160.0f);
|
||||
Matrix_RotateY(this->actor.yawTowardsPlayer, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.yawTowardsPlayer, MTXMODE_NEW);
|
||||
}
|
||||
|
||||
switch (this->unk_708) {
|
||||
@@ -339,7 +339,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
|
||||
case 1:
|
||||
player->actor.shape.rot.y = 0x7FFF;
|
||||
player->actor.world.rot.y = player->actor.shape.rot.y;
|
||||
Matrix_GetStateTranslationAndScaledZ(-100.0f, &this->unk_70C);
|
||||
Matrix_MultVecZ(-100.0f, &this->unk_70C);
|
||||
|
||||
this->unk_70C.x += player->actor.world.pos.x;
|
||||
this->unk_70C.y = Player_GetHeight(player) + player->actor.world.pos.y + 36.0f;
|
||||
@@ -358,7 +358,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
Matrix_GetStateTranslationAndScaledZ(500.0f, &this->unk_70C);
|
||||
Matrix_MultVecZ(500.0f, &this->unk_70C);
|
||||
this->unk_70C.x += this->actor.world.pos.x;
|
||||
this->unk_70C.y += this->actor.world.pos.y - 50.0f;
|
||||
this->unk_70C.z += this->actor.world.pos.z;
|
||||
@@ -591,82 +591,82 @@ void func_809ED50C(Boss04* this) {
|
||||
this->unk_2DE += this->unk_2E2;
|
||||
this->unk_2DC += this->unk_2E0;
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 10.0f, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&this->unk_6BC);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, 10.0f, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&this->unk_6BC);
|
||||
Matrix_Scale(this->actor.scale.x * 13.0f, this->actor.scale.y * 13.0f, this->actor.scale.z * 16.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_2DC, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_2DE, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_2DC, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_2DE, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_2E4); i++) {
|
||||
Matrix_RotateStateAroundXAxis(0.3926991f);
|
||||
Matrix_GetStateTranslationAndScaledZ(100.0f, &this->unk_2E4[i]);
|
||||
Matrix_RotateXFApply(0.3926991f);
|
||||
Matrix_MultVecZ(100.0f, &this->unk_2E4[i]);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(38.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_Push();
|
||||
Matrix_Translate(38.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_3A4); i++) {
|
||||
Matrix_RotateStateAroundXAxis(0.41887903f);
|
||||
Matrix_GetStateTranslationAndScaledZ(92.0f, &this->unk_3A4[i]);
|
||||
Matrix_RotateXFApply(0.41887903f);
|
||||
Matrix_MultVecZ(92.0f, &this->unk_3A4[i]);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(-38.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-38.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_458); i++) {
|
||||
Matrix_RotateStateAroundXAxis(0.41887903f);
|
||||
Matrix_GetStateTranslationAndScaledZ(92.0f, &this->unk_458[i]);
|
||||
Matrix_RotateXFApply(0.41887903f);
|
||||
Matrix_MultVecZ(92.0f, &this->unk_458[i]);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(71.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_Push();
|
||||
Matrix_Translate(71.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_50C); i++) {
|
||||
Matrix_RotateStateAroundXAxis(0.5711987f);
|
||||
Matrix_GetStateTranslationAndScaledZ(71.0f, &this->unk_50C[i]);
|
||||
Matrix_RotateXFApply(0.5711987f);
|
||||
Matrix_MultVecZ(71.0f, &this->unk_50C[i]);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(-71.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-71.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_590); i++) {
|
||||
Matrix_RotateStateAroundXAxis(0.5711987f);
|
||||
Matrix_GetStateTranslationAndScaledZ(71.0f, &this->unk_590[i]);
|
||||
Matrix_RotateXFApply(0.5711987f);
|
||||
Matrix_MultVecZ(71.0f, &this->unk_590[i]);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(92.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_Push();
|
||||
Matrix_Translate(92.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_614); i++) {
|
||||
Matrix_RotateStateAroundXAxis(1.0471976f);
|
||||
Matrix_GetStateTranslationAndScaledZ(38.0f, &this->unk_614[i]);
|
||||
Matrix_RotateXFApply(1.0471976f);
|
||||
Matrix_MultVecZ(38.0f, &this->unk_614[i]);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(-92.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_Push();
|
||||
Matrix_Translate(-92.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_65C); i++) {
|
||||
Matrix_RotateStateAroundXAxis(1.0471976f);
|
||||
Matrix_GetStateTranslationAndScaledZ(38.0f, &this->unk_65C[i]);
|
||||
Matrix_RotateXFApply(1.0471976f);
|
||||
Matrix_MultVecZ(38.0f, &this->unk_65C[i]);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(100.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_Push();
|
||||
Matrix_Translate(100.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
Matrix_GetStateTranslation(&this->unk_6A4);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(-100.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_GetStateTranslation(&this->unk_6B0);
|
||||
Matrix_MultZero(&this->unk_6A4);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(-100.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_MultZero(&this->unk_6B0);
|
||||
}
|
||||
|
||||
void Boss04_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
@@ -805,10 +805,10 @@ void Boss04_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
Vec3f sp18;
|
||||
|
||||
if (limbIndex == 1) {
|
||||
Matrix_GetStateTranslationAndScaledY(-500.0f, &this->actor.focus.pos);
|
||||
Matrix_MultiplyVector3fByState(&D_809EE228, &sp18);
|
||||
Matrix_MultVecY(-500.0f, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_809EE228, &sp18);
|
||||
func_809EC040(0, &this->collider1, &sp18);
|
||||
Matrix_MultiplyVector3fByState(&D_809EE234, &sp18);
|
||||
Matrix_MultVec3f(&D_809EE234, &sp18);
|
||||
func_809EC040(0, &this->collider2, &sp18);
|
||||
}
|
||||
}
|
||||
@@ -824,7 +824,7 @@ void Boss04_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099);
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 800.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, 800.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->unk_6F8, this->unk_6FC, this->unk_700, MTXMODE_APPLY);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
Boss04_OverrideLimbDraw, Boss04_PostLimbDraw, &this->actor);
|
||||
@@ -837,9 +837,9 @@ void Boss04_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 150);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_boss04_DL_004510);
|
||||
|
||||
Matrix_InsertTranslation(this->unk_6BC.x, this->actor.floorHeight, this->unk_6BC.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, -20.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->unk_6BC.x, this->actor.floorHeight, this->unk_6BC.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, -20.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->unk_6F8 * 1.8f, 0.0f, this->unk_700 * 2.8f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -467,15 +467,14 @@ void Boss06_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
phi_f24 = 0.0f;
|
||||
|
||||
for (i = 0; i < 1024; i++) {
|
||||
temp_f22 =
|
||||
(((__sinf(phi_f24) * this->unk_1D4) + 1.0f) * ((__sinf(phi_f26) * this->unk_1D0) + this->unk_1D0)) +
|
||||
this->unk_1CC;
|
||||
temp_f22 = (((sinf(phi_f24) * this->unk_1D4) + 1.0f) * ((sinf(phi_f26) * this->unk_1D0) + this->unk_1D0)) +
|
||||
this->unk_1CC;
|
||||
|
||||
phi_f26 += (M_PI / 64);
|
||||
phi_f24 += 0.030679617f;
|
||||
|
||||
Matrix_InsertZRotation_f(i * (M_PI / 512), MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledY(temp_f22, &sp7C);
|
||||
Matrix_RotateZF(i * (M_PI / 512), MTXMODE_NEW);
|
||||
Matrix_MultVecY(temp_f22, &sp7C);
|
||||
|
||||
sp7C.x += 32.0f + this->unk_1BC;
|
||||
sp7C.y += 32.0f + this->unk_1C0;
|
||||
@@ -573,10 +572,10 @@ void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
}
|
||||
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_knight_Matanimheader_019360));
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y - 234.0f,
|
||||
this->actor.world.pos.z + 30.0f, 0);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y - 234.0f, this->actor.world.pos.z + 30.0f,
|
||||
MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, -1112.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, -1112.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 155, 255, maxColor, (u8)((140.0f * sp68) + 115.0f), spD3);
|
||||
@@ -590,18 +589,18 @@ void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
if (this->unk_144 & 1) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&this->unk_200));
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + this->unk_1A8,
|
||||
this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + this->unk_1A8, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_knight_DL_0193B0);
|
||||
|
||||
if (this->unk_1D8 > 0.0f) {
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + 84.0f,
|
||||
this->actor.world.pos.z - 2.0f, MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + 84.0f, this->actor.world.pos.z - 2.0f,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
func_809F2120(1, 0x71A5, 0x263A);
|
||||
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 10, 0, 0);
|
||||
@@ -609,18 +608,18 @@ void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_809F4370); i++) {
|
||||
if ((fabsf(D_809F4370[i].x - 32.0f) < 30.0f) && (fabsf(D_809F4370[i].y - 32.0f) < 30.0f)) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0,
|
||||
((globalCtx->gameplayFrames + (i * 10)) * -20) % 512, 0x20, 0x80));
|
||||
|
||||
Matrix_InsertTranslation((D_809F4370[i].x - 32.0f) * -2.4f, (D_809F4370[i].y - 32.0f) * -2.4f, 0.0f,
|
||||
MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(i * (M_PI / 64), MTXMODE_APPLY);
|
||||
Matrix_Translate((D_809F4370[i].x - 32.0f) * -2.4f, (D_809F4370[i].y - 32.0f) * -2.4f, 0.0f,
|
||||
MTXMODE_APPLY);
|
||||
Matrix_RotateZF(i * (M_PI / 64), MTXMODE_APPLY);
|
||||
|
||||
if (func_809F2140() < 0.5f) {
|
||||
Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
Matrix_Scale(-0.02f / 10.0f, -this->unk_1D8, 1.0f, MTXMODE_APPLY);
|
||||
@@ -629,7 +628,7 @@ void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -640,16 +639,15 @@ void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
if (this->unk_1DC > 0.0f) {
|
||||
u8 temp_s2 = (this->unk_1E0 - 50.0f) + (50.0f * sp68);
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x + this->unk_1B0,
|
||||
this->actor.world.pos.y + 84.0f + this->unk_1B4,
|
||||
(this->actor.world.pos.z - 2.0f) + spE0, MTXMODE_NEW);
|
||||
Matrix_Translate(this->actor.world.pos.x + this->unk_1B0, this->actor.world.pos.y + 84.0f + this->unk_1B4,
|
||||
(this->actor.world.pos.z - 2.0f) + spE0, MTXMODE_NEW);
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, gLightOrb1DL);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, (u8)((140.0f * sp68) + 115.0f), temp_s2);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 205, (u8)((100.0f * sp68) + 65.0f), 128);
|
||||
|
||||
Matrix_Scale(this->unk_1DC, this->unk_1DC, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(globalCtx->gameplayFrames * 64, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(globalCtx->gameplayFrames * 64, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gLightOrbVtxDL);
|
||||
|
||||
@@ -297,15 +297,15 @@ void func_808CE078(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 255, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->unk_168[0], this->unk_168[1], this->unk_168[2], 255);
|
||||
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertZRotation_s(sp46, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
Matrix_RotateZS(sp46, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023288);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertZRotation_s(sp46 * -1, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_RotateZS(sp46 * -1, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023288);
|
||||
|
||||
@@ -153,12 +153,9 @@ void DemoKakyo_LostWoodsSparkleActionFunc(DemoKankyo* this, GlobalContext* globa
|
||||
|
||||
Math_SmoothStepToF(&this->particles[i].scale, 0.1, 0.1f, 0.001f, 0.00001f);
|
||||
Math_SmoothStepToF(&this->particles[i].speed, this->particles[i].speedTarget, 0.5f, 0.2f, 0.02f);
|
||||
this->particles[i].posOffset.x +=
|
||||
__sinf(this->particles[i].speedClock.x) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.y +=
|
||||
__sinf(this->particles[i].speedClock.y) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.z +=
|
||||
__sinf(this->particles[i].speedClock.z) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.x += sinf(this->particles[i].speedClock.x) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.y += sinf(this->particles[i].speedClock.y) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.z += sinf(this->particles[i].speedClock.z) * this->particles[i].speed;
|
||||
|
||||
switch ((i >> 1) & 3) {
|
||||
case 0:
|
||||
@@ -205,7 +202,7 @@ void DemoKakyo_LostWoodsSparkleActionFunc(DemoKankyo* this, GlobalContext* globa
|
||||
this->particles[i].LostWoodsSkyFishPosOffsetMax,
|
||||
0.5f, 2.0f, 0.2f);
|
||||
this->particles[i].LostWoodsSkyFishSpeedXZClock += this->particles[i].LostWoodsSkyFishSpeedXZ;
|
||||
this->particles[i].posOffset.y += __sinf(this->particles[i].speedClock.y);
|
||||
this->particles[i].posOffset.y += sinf(this->particles[i].speedClock.y);
|
||||
this->particles[i].speedClock.x += 0.2f * Rand_ZeroOne(); // unused calculation
|
||||
this->particles[i].speedClock.y += this->particles[i].LostWoodsSkyFishSpeedY;
|
||||
this->particles[i].speedClock.z += 0.1f * Rand_ZeroOne(); // unused calculation
|
||||
@@ -377,9 +374,9 @@ void DemoKakyo_MoonSparklesActionFunc(DemoKankyo* this, GlobalContext* globalCtx
|
||||
Math_SmoothStepToF(&this->particles[i].scale, 0.2f, 0.1f, 0.001f, 0.00001f);
|
||||
Math_SmoothStepToF(&this->particles[i].speed, this->particles[i].speedTarget, 0.5f, 0.2f, 0.02f);
|
||||
|
||||
this->particles[i].posOffset.x += __sinf(this->particles[i].speedClock.x) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.y += __sinf(this->particles[i].speedClock.y) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.z += __sinf(this->particles[i].speedClock.z) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.x += sinf(this->particles[i].speedClock.x) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.y += sinf(this->particles[i].speedClock.y) * this->particles[i].speed;
|
||||
this->particles[i].posOffset.z += sinf(this->particles[i].speedClock.z) * this->particles[i].speed;
|
||||
|
||||
switch ((i >> 1) & 3) {
|
||||
case 0:
|
||||
@@ -536,7 +533,7 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
// checking if particle is on screen
|
||||
if (screenPos.x >= 0.0f && screenPos.x < SCREEN_WIDTH && screenPos.y >= 0.0f &&
|
||||
screenPos.y < SCREEN_HEIGHT) {
|
||||
Matrix_InsertTranslation(worldPos.x, worldPos.y, worldPos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(worldPos.x, worldPos.y, worldPos.z, MTXMODE_NEW);
|
||||
scaleAlpha = this->particles[i].alpha / 50.0f;
|
||||
if (scaleAlpha > 1.0f) {
|
||||
scaleAlpha = 1.0f;
|
||||
@@ -586,8 +583,8 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
break;
|
||||
}
|
||||
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(DEGF_TO_RADF(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(DEGF_TO_RADF(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -625,7 +622,7 @@ void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
// checking if particle is on screen
|
||||
if (screenPos.x >= 0.0f && screenPos.x < SCREEN_WIDTH && screenPos.y >= 0.0f &&
|
||||
screenPos.y < SCREEN_HEIGHT) {
|
||||
Matrix_InsertTranslation(worldPos.x, worldPos.y, worldPos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(worldPos.x, worldPos.y, worldPos.z, MTXMODE_NEW);
|
||||
alphaScale = this->particles[i].alpha / 50.0f;
|
||||
if (alphaScale > 1.0f) {
|
||||
alphaScale = 1.0f;
|
||||
@@ -657,9 +654,9 @@ void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, &gLightOrb1DL);
|
||||
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
|
||||
Matrix_InsertZRotation_f(DEGF_TO_RADF(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
Matrix_RotateZF(DEGF_TO_RADF(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -489,7 +489,7 @@ void func_80C173B4(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (matrix != NULL) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
func_8018450C(globalCtx, &this->unk_144, matrix, (void*)func_80C170F8, 0, &this->actor);
|
||||
}
|
||||
}
|
||||
@@ -518,14 +518,14 @@ void DemoSyoten_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
if (this->unk_3E4 & 4) {
|
||||
Matrix_InsertZRotation_s(-this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, 5.0f, 1.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (this->unk_3E4 & 1) {
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (this->unk_3E4 & 8) {
|
||||
@@ -555,7 +555,7 @@ void func_80C17690(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
Matrix_RotateY(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
|
||||
Matrix_RotateYS(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
|
||||
|
||||
if (this->unk_3E4 & 8) {
|
||||
func_80C17468(globalCtx);
|
||||
|
||||
@@ -280,21 +280,21 @@ void func_80C1CD80(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
if ((limbIndex == OBJECT_AN1_LIMB_05) && (this->unk_2D4 != 0)) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_JointPosition(&D_80C1D2C8, &D_80C1D2D4);
|
||||
Matrix_Push();
|
||||
Matrix_TranslateRotateZYX(&D_80C1D2C8, &D_80C1D2D4);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[sp2A].segment);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gMoonMaskDL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[sp2B].segment);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
if (limbIndex == OBJECT_AN1_LIMB_09) {
|
||||
Matrix_MultiplyVector3fByState(&D_80C1D2DC, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_80C1D2DC, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
}
|
||||
}
|
||||
@@ -320,23 +320,23 @@ void func_80C1CEFC(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
|
||||
SubS_UpdateLimb(this->unk_2BE + this->unk_2C2 + 0x4000,
|
||||
this->unk_2C0 + this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_18C,
|
||||
&this->unk_1A4, stepRot, overrideRot);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_1A4.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_1A4.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_1A4.z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_1A4.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1A4.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1A4.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
} else if (limbIndex == OBJECT_AN1_LIMB_02) {
|
||||
SubS_UpdateLimb(this->unk_2C2 + 0x4000, this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_194,
|
||||
&this->unk_1AA, stepRot, overrideRot);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_1AA.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_1AA.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_1AA.z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_1AA.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1AA.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1AA.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -901,8 +901,8 @@ s32 DmChar00_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
|
||||
|
||||
if (limbIndex == 6) {
|
||||
sp28 = ((Math_SinS(this->unk_262 * 0x1000) * 0.1f) + 1.0f) * 0.012f * (this->actor.scale.x * 124.99999f);
|
||||
Matrix_MultiplyVector3fByState(&D_80AA7808, &sp1C);
|
||||
Matrix_InsertTranslation(sp1C.x, sp1C.y, sp1C.z, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&D_80AA7808, &sp1C);
|
||||
Matrix_Translate(sp1C.x, sp1C.y, sp1C.z, MTXMODE_NEW);
|
||||
Matrix_Scale(sp28, sp28, sp28, MTXMODE_APPLY);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -411,7 +411,7 @@ void DmChar01_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_0110B8));
|
||||
Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_010FD8);
|
||||
Gfx_DrawDListXlu(globalCtx, object_mtoride_DL_010EF0);
|
||||
Matrix_InsertTranslation(0.0f, 10.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 10.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_009D70));
|
||||
|
||||
|
||||
@@ -671,7 +671,7 @@ void func_80AADC00(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (globalCtx->csCtx.actorActions[actionIndex]->action == 4) {
|
||||
Matrix_InsertTranslation(-600.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(-600.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Gfx_DrawDListOpa(globalCtx, object_dmask_DL_001E70);
|
||||
}
|
||||
}
|
||||
@@ -716,8 +716,8 @@ void DmChar05_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
void func_80AADD9C(GlobalContext* globalCtx, DmChar05* this) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, GID_44);
|
||||
}
|
||||
@@ -729,8 +729,8 @@ void func_80AADD9C(GlobalContext* globalCtx, DmChar05* this) {
|
||||
|
||||
void func_80AADE78(GlobalContext* globalCtx, DmChar05* this) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, GID_45);
|
||||
}
|
||||
@@ -742,8 +742,8 @@ void func_80AADE78(GlobalContext* globalCtx, DmChar05* this) {
|
||||
|
||||
void func_80AADF54(GlobalContext* globalCtx, DmChar05* this) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, GID_6B);
|
||||
}
|
||||
@@ -756,8 +756,8 @@ void func_80AADF54(GlobalContext* globalCtx, DmChar05* this) {
|
||||
void func_80AAE030(GlobalContext* globalCtx, DmChar05* this) {
|
||||
if (this->unk_18E != 0) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, GID_03);
|
||||
}
|
||||
@@ -776,9 +776,8 @@ void func_80AAE114(GlobalContext* globalCtx, DmChar05* this) {
|
||||
|
||||
sp34 = DMCHAR05_GET(&this->actor) - DMCHAR05_5;
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, sp24[sp34]);
|
||||
}
|
||||
|
||||
@@ -280,21 +280,21 @@ void DmGm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
if ((limbIndex == OBJECT_AN1_LIMB_05) && (this->unk_2D4 != 0)) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_JointPosition(&D_80C25218, &D_80C25224);
|
||||
Matrix_Push();
|
||||
Matrix_TranslateRotateZYX(&D_80C25218, &D_80C25224);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[sp2A].segment);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gMoonMaskDL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[sp2B].segment);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
if (limbIndex == OBJECT_AN1_LIMB_09) {
|
||||
Matrix_MultiplyVector3fByState(&D_80C2522C, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_80C2522C, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
}
|
||||
}
|
||||
@@ -320,23 +320,23 @@ void DmGm_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* this
|
||||
SubS_UpdateLimb(this->unk_2BE + this->unk_2C2 + 0x4000,
|
||||
this->unk_2C0 + this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_18C,
|
||||
&this->unk_1A4, stepRot, overrideRot);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_1A4.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_1A4.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_1A4.z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_1A4.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1A4.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1A4.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
} else if (limbIndex == OBJECT_AN1_LIMB_02) {
|
||||
SubS_UpdateLimb(this->unk_2C2 + 0x4000, this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_194,
|
||||
&this->unk_1AA, stepRot, overrideRot);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_1AA.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_1AA.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_1AA.z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_1AA.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1AA.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1AA.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1618,7 +1618,7 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
DmStk* this = THIS;
|
||||
|
||||
if (limbIndex == 17) {
|
||||
Matrix_GetStateTranslation(&this->unk_304);
|
||||
Matrix_MultZero(&this->unk_304);
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -1658,7 +1658,7 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
if (Cutscene_CheckActorAction(globalCtx, 513) &&
|
||||
(globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 513)]->action == 2) &&
|
||||
(this->unk_337 >= 0)) {
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY);
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_337].segment);
|
||||
|
||||
@@ -1670,7 +1670,7 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_336].segment);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1706,9 +1706,9 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
break;
|
||||
|
||||
case 5:
|
||||
Matrix_InsertTranslation(-20.0f, -660.0f, 860.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateY(0x6142, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(-0x1988, MTXMODE_APPLY);
|
||||
Matrix_Translate(-20.0f, -660.0f, 860.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(0x6142, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(-0x1988, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -673,9 +673,9 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
|
||||
if (this->unk_164 == 7) {
|
||||
Matrix_InsertTranslation(0.0f, 64.96f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -64.96f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 64.96f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->actor.home.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, -64.96f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (sp44->unk_04 != 0) {
|
||||
@@ -687,10 +687,10 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s16 yaw = this->actor.shape.rot.y - Math_Vec3f_Yaw(&globalCtx->view.eye, &this->actor.world.pos);
|
||||
|
||||
if (ABS_ALT(yaw) < 0x4000) {
|
||||
Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
}
|
||||
} else if (this->actor.room == transitionEntry->sides[0].room) {
|
||||
Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
}
|
||||
} else if (this->doorType == 5) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_808A22DC[this->unk_15E]));
|
||||
@@ -700,7 +700,7 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, sp44->unk_00);
|
||||
|
||||
if ((this->unk_168 != 0.0f) && (sp44->unk_04 != 0)) {
|
||||
Matrix_InsertTranslation(0.0f, sp44->unk_08 * (1.0f - this->unk_168), sp44->translateZ, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, sp44->unk_08 * (1.0f - this->unk_168), sp44->translateZ, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -972,8 +972,8 @@ void func_808BAE9C(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255.0f * sp84, 255, 255, (u8)this->unk_1B4);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 255.0f * sp84, 255, 255);
|
||||
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 1.0f,
|
||||
this->dyna.actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 1.0f, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
phi_f12 = 1.0f;
|
||||
if (this->unk_203 != 0) {
|
||||
phi_f12 = this->unk_204 * phi_f12;
|
||||
@@ -981,19 +981,19 @@ void func_808BAE9C(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||
Matrix_Scale(phi_f12, phi_f12, phi_f12, MTXMODE_APPLY);
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0A, Matrix_NewMtx(globalCtx->state.gfxCtx));
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, sp94 & 0xFF, -((s16)(2.0f * this->unk_1AC) & 0x1FF), 0x100,
|
||||
0x100, 1, sp94 & 0xFF, -((s16)(2.0f * this->unk_1AC) & 0x1FF), 0x100, 0x100));
|
||||
|
||||
Matrix_InsertTranslation(0.0f, this->unk_1A4 * 230.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, this->unk_1A4 * 230.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(((this->unk_1C6 * sp90) / 100.0f) + 1.0f, 1.0f, ((this->unk_1C6 * sp90) / 100.0f) + 1.0f,
|
||||
MTXMODE_APPLY);
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x09, Matrix_NewMtx(globalCtx->state.gfxCtx));
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_warp1_DL_0001A0);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
if (this->unk_1B0 > 0.0f) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255.0f * sp84, 255, 255, (u8)this->unk_1B0);
|
||||
@@ -1004,7 +1004,7 @@ void func_808BAE9C(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, sp94 & 0xFF, -((s16)this->unk_1AC & 0x1FF), 0x100,
|
||||
0x100, 1, sp94 & 0xFF, -((s16)this->unk_1AC & 0x1FF), 0x100, 0x100));
|
||||
|
||||
Matrix_InsertTranslation(0.0f, this->unk_1A8 * 60.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, this->unk_1A8 * 60.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(((this->unk_1C8 * sp8C) / 100.0f) + 1.0f, 1.0f, ((this->unk_1C8 * sp8C) / 100.0f) + 1.0f,
|
||||
MTXMODE_APPLY);
|
||||
|
||||
@@ -1031,8 +1031,8 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) {
|
||||
s32 sp60 = 0;
|
||||
|
||||
if (this->unk_1D4 != 0) {
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + this->unk_1A4,
|
||||
this->dyna.actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + this->unk_1A4,
|
||||
this->dyna.actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(4.0f, this->unk_1AC, 4.0f, MTXMODE_APPLY);
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_0044D8));
|
||||
Gfx_DrawDListXlu(globalCtx, object_warp1_DL_003230);
|
||||
@@ -1049,9 +1049,9 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) {
|
||||
}
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, this->unk_1A8, 1.0f, MTXMODE_APPLY);
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_0057D8));
|
||||
|
||||
@@ -1069,9 +1069,9 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_007238));
|
||||
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Scale(1.0f, 0.0f, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -283,14 +283,14 @@ void func_80919768(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
for (i = 0; i < ARRAY_COUNT(this->distanceTraveled); i++) {
|
||||
if (*distanceTraveled < 1.0f) {
|
||||
aux = 1.0f - SQ(*distanceTraveled);
|
||||
Matrix_InsertTranslation(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(sp92, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
initialPositions->y * ((this->dy * aux) + (1.0f - this->dy)),
|
||||
initialPositions->z * ((this->dz * aux) + (1.0f - this->dz)), MTXMODE_APPLY);
|
||||
Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(sp92, MTXMODE_APPLY);
|
||||
Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
initialPositions->y * ((this->dy * aux) + (1.0f - this->dy)),
|
||||
initialPositions->z * ((this->dz * aux) + (1.0f - this->dz)), MTXMODE_APPLY);
|
||||
Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY);
|
||||
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -339,15 +339,15 @@ void func_809199FC(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (*distanceTraveled * 255.0f));
|
||||
|
||||
aux = 1.0f - SQ(*distanceTraveled);
|
||||
Matrix_InsertMatrix(&player->mf_CC4, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
(initialPositions->y * (1.0f - *distanceTraveled)) + 320.0f,
|
||||
(initialPositions->z * (1.0f - *distanceTraveled)) + -20.0f, MTXMODE_APPLY);
|
||||
Matrix_Mult(&player->mf_CC4, MTXMODE_NEW);
|
||||
Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
(initialPositions->y * (1.0f - *distanceTraveled)) + 320.0f,
|
||||
(initialPositions->z * (1.0f - *distanceTraveled)) + -20.0f, MTXMODE_APPLY);
|
||||
|
||||
Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor,
|
||||
*distanceTraveled * this->scalingFactor, MTXMODE_APPLY);
|
||||
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
|
||||
|
||||
@@ -568,7 +568,7 @@ void EnAh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
EnAh* this = THIS;
|
||||
|
||||
if (limbIndex == 7) {
|
||||
Matrix_MultiplyVector3fByState(&D_80BD3F00, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_80BD3F00, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
}
|
||||
}
|
||||
@@ -594,23 +594,23 @@ void EnAh_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* this
|
||||
SubS_UpdateLimb(BINANG_ADD(this->unk_2EC + this->unk_2F0, 0x4000),
|
||||
BINANG_ADD(this->unk_2EE + this->unk_2F2 + this->actor.shape.rot.y, 0x4000), this->unk_1E8,
|
||||
this->unk_200, stepRot, overrideRot);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_1E8[0].x, this->unk_1E8[0].y, this->unk_1E8[0].z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_1E8[0].x, this->unk_1E8[0].y, this->unk_1E8[0].z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_200[0].y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_200[0].x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_200[0].z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_200[0].y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_200[0].x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_200[0].z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
} else if (limbIndex == 2) {
|
||||
SubS_UpdateLimb(BINANG_ADD(this->unk_2F0, 0x4000), BINANG_ADD(this->unk_2F2 + this->actor.shape.rot.y, 0x4000),
|
||||
&this->unk_1E8[1], &this->unk_200[1], stepRot, overrideRot);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_1E8[1].x, this->unk_1E8[1].y, this->unk_1E8[1].z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_1E8[1].x, this->unk_1E8[1].y, this->unk_1E8[1].z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_200[1].y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_200[1].x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_200[1].z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_200[1].y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_200[1].x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_200[1].z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1699,7 +1699,7 @@ void EnAkindonuts_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Act
|
||||
}
|
||||
|
||||
if (limbIndex == 24) {
|
||||
Matrix_RotateY(this->unk_352, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->unk_352, MTXMODE_APPLY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -839,31 +839,31 @@ void EnAl_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
|
||||
switch (limbIndex) {
|
||||
case 3:
|
||||
Matrix_CopyCurrentState(&this->unk_190[0]);
|
||||
Matrix_Get(&this->unk_190[0]);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
Matrix_CopyCurrentState(&this->unk_190[1]);
|
||||
Matrix_Get(&this->unk_190[1]);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
Matrix_CopyCurrentState(&this->unk_190[2]);
|
||||
Matrix_Get(&this->unk_190[2]);
|
||||
break;
|
||||
|
||||
case 13:
|
||||
Matrix_CopyCurrentState(&this->unk_190[3]);
|
||||
Matrix_Get(&this->unk_190[3]);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
Matrix_CopyCurrentState(&this->unk_190[4]);
|
||||
Matrix_Get(&this->unk_190[4]);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
Matrix_CopyCurrentState(&this->unk_190[5]);
|
||||
Matrix_Get(&this->unk_190[5]);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
Matrix_MultiplyVector3fByState(&D_80BE0070, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_80BE0070, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
break;
|
||||
}
|
||||
@@ -889,13 +889,13 @@ void EnAl_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* this
|
||||
if (limbIndex == 16) {
|
||||
SubS_UpdateLimb(this->unk_4DC + 0x4000, this->unk_4DE + this->actor.shape.rot.y + 0x4000, &this->unk_36C,
|
||||
&this->unk_378, stepRot, overrideRot);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_36C.x, this->unk_36C.y, this->unk_36C.z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_36C.x, this->unk_36C.y, this->unk_36C.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_378.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_378.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_378.z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_378.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_378.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_378.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -907,13 +907,13 @@ void EnAl_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 850.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, 850.0f, MTXMODE_APPLY);
|
||||
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, EnAl_OverrideLimbDraw, EnAl_PostLimbDraw,
|
||||
EnAl_TransformLimbDraw, &this->actor);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->unk_190); i++) {
|
||||
Matrix_SetCurrentState(&this->unk_190[i]);
|
||||
Matrix_Put(&this->unk_190[i]);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -551,7 +551,7 @@ void EnAm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
phi_s3 = 0;
|
||||
}
|
||||
for (i = 0; i < phi_s3; i++, phi_s2++, phi_s1++) {
|
||||
Matrix_MultiplyVector3fByState(phi_s1, phi_s2);
|
||||
Matrix_MultVec3f(phi_s1, phi_s2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
static Vec3f D_809686A4 = { 800.0f, 500.0f, 0.0f };
|
||||
|
||||
if (limbIndex == ANI_LIMB_HEAD) {
|
||||
Matrix_MultiplyVector3fByState(&D_809686A4, &thisx->focus.pos);
|
||||
Matrix_MultVec3f(&D_809686A4, &thisx->focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ void EnAni_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, -1000.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, -1000.0f, MTXMODE_APPLY);
|
||||
func_8012C5B0(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeState]));
|
||||
|
||||
@@ -999,15 +999,15 @@ s32 EnAob01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
}
|
||||
|
||||
if (limbIndex == MAMAMU_YAN_LIMB_HEAD) {
|
||||
Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->headRot.x * -1, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->headRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->headRot.x * -1, MTXMODE_APPLY);
|
||||
Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (limbIndex == MAMAMU_YAN_LIMB_TORSO) {
|
||||
Matrix_InsertXRotation_s(this->torsoRot.y * -1, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->torsoRot.x * -1, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->torsoRot.y * -1, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->torsoRot.x * -1, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if ((limbIndex == MAMAMU_YAN_LIMB_TORSO) || (limbIndex == MAMAMU_YAN_LIMB_LEFT_UPPER_ARM) ||
|
||||
@@ -1023,7 +1023,7 @@ void EnAob01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
EnAob01* this = THIS;
|
||||
|
||||
if (limbIndex == MAMAMU_YAN_LIMB_HEAD) {
|
||||
Matrix_MultiplyVector3fByState(&D_809C3968, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_809C3968, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -579,15 +579,15 @@ void func_8088B88C(GlobalContext* globalCtx, EnArrow* this, EnArrowUnkStruct* ar
|
||||
Vec3f sp34;
|
||||
s32 sp30;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&arg2->unk_48, &this->unk_234);
|
||||
Matrix_MultVec3f(&arg2->unk_48, &this->unk_234);
|
||||
if (func_8088ACE0 == this->actionFunc) {
|
||||
if (!this->unk_244.active) {
|
||||
sp4C = arg2->unk_00;
|
||||
} else {
|
||||
sp4C = arg2->unk_18[globalCtx->gameplayFrames % 2];
|
||||
}
|
||||
Matrix_MultiplyVector3fByState(&sp4C[0], &sp40);
|
||||
Matrix_MultiplyVector3fByState(&sp4C[1], &sp34);
|
||||
Matrix_MultVec3f(&sp4C[0], &sp40);
|
||||
Matrix_MultVec3f(&sp4C[1], &sp34);
|
||||
if (this->actor.params < ENARROW_8) {
|
||||
sp30 = this->actor.params < ENARROW_6;
|
||||
if (this->unk_264 == 0) {
|
||||
@@ -666,7 +666,7 @@ void EnArrow_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Matrix_Scale(this->bubble.unk_144 * sp9C, this->bubble.unk_144 * sp9C, this->bubble.unk_144 * spA0,
|
||||
MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 460.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, 460.0f, MTXMODE_APPLY);
|
||||
|
||||
if (this->actor.speedXZ == 0.0f) {
|
||||
func_800B8118(&this->actor, globalCtx, MTXMODE_NEW);
|
||||
@@ -677,7 +677,7 @@ void EnArrow_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
COMBINED, 0, ENVIRONMENT, 0, COMBINED, 0, ENVIRONMENT, 0);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 230, 225, 150, spA4);
|
||||
|
||||
Matrix_NormalizeXYZ(&gIdentityMtxF);
|
||||
Matrix_ReplaceRotation(&gIdentityMtxF);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -718,8 +718,8 @@ void EnArrow_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
sp5C = 150.0f;
|
||||
}
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
|
||||
if (this->actor.speedXZ == 0.0f) {
|
||||
phi_v0 = 0;
|
||||
@@ -727,21 +727,21 @@ void EnArrow_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
phi_v0 = (globalCtx->gameplayFrames % 256) * 4000;
|
||||
}
|
||||
|
||||
Matrix_InsertZRotation_s(phi_v0, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(phi_v0, MTXMODE_APPLY);
|
||||
Matrix_Scale(sp5C, sp5C, sp5C, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffSparklesDL);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_RotateY(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Pop();
|
||||
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
} else if (this->actor.velocity.y != 0.0f) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_058BA0);
|
||||
|
||||
@@ -700,19 +700,19 @@ s32 EnBaba_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
|
||||
EnBaba* this = THIS;
|
||||
|
||||
if (limbIndex == 6) {
|
||||
Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(-this->headRot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->headRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->headRot.x, MTXMODE_APPLY);
|
||||
Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (limbIndex == 5) {
|
||||
Matrix_InsertXRotation_s(-this->torsoRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(-this->torsoRot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(-this->torsoRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->torsoRot.x, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if ((limbIndex == 6) && (this->unk_1E2 != 0) && ((globalCtx->state.frames % 2) == 0)) {
|
||||
Matrix_InsertTranslation(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if ((limbIndex == 5) || (limbIndex == 10) || (limbIndex == 14)) {
|
||||
@@ -736,7 +736,7 @@ void EnBaba_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
this->actor.focus.pos.x = this->actor.world.pos.x;
|
||||
this->actor.focus.pos.y = this->actor.world.pos.y;
|
||||
this->actor.focus.pos.z = this->actor.world.pos.z;
|
||||
Matrix_MultiplyVector3fByState(&sp18, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&sp18, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -498,10 +498,10 @@ void EnBaguo_DrawRockParticles(EnBaguo* this, GlobalContext* globalCtx) {
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) {
|
||||
if (particle->isVisible) {
|
||||
Matrix_InsertTranslation(particle->position.x, particle->position.y, particle->position.z, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(particle->rotation.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(particle->rotation.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(particle->rotation.z, MTXMODE_APPLY);
|
||||
Matrix_Translate(particle->position.x, particle->position.y, particle->position.z, MTXMODE_NEW);
|
||||
Matrix_RotateXS(particle->rotation.x, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(particle->rotation.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(particle->rotation.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(particle->scale, particle->scale, particle->scale, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -640,17 +640,17 @@ void EnBb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
if (this->bodyPartDrawStatus == BB_BODY_PART_DRAW_STATUS_ALIVE) {
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] == 0) {
|
||||
Matrix_GetStateTranslationAndScaledX(1000.0f, &this->bodyPartsPos[0]);
|
||||
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[0]);
|
||||
} else if (sLimbIndexToBodyPartsIndex[limbIndex] == 3) {
|
||||
Matrix_GetStateTranslationAndScaledX(-1000.0f, &this->bodyPartsPos[3]);
|
||||
Matrix_MultiplyVector3fByState(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
|
||||
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[3]);
|
||||
Matrix_MultVec3f(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
|
||||
} else {
|
||||
Matrix_GetStateTranslation(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
}
|
||||
}
|
||||
} else if (this->bodyPartDrawStatus > BB_BODY_PART_DRAW_STATUS_ALIVE) {
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
|
||||
Matrix_GetStateTranslation(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
}
|
||||
|
||||
if (limbIndex == BUBBLE_LIMB_CRANIUM) {
|
||||
@@ -660,11 +660,11 @@ void EnBb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
currentMatrixState = Matrix_GetCurrentState();
|
||||
currentMatrixState = Matrix_GetCurrent();
|
||||
currentMatrixState->mf[3][0] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].x;
|
||||
currentMatrixState->mf[3][1] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].y;
|
||||
currentMatrixState->mf[3][2] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].z;
|
||||
Matrix_InsertZRotation_s(thisx->world.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(thisx->world.rot.z, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, this->limbDList);
|
||||
@@ -689,9 +689,9 @@ void EnBb_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBb_PostLimbDraw, &this->actor);
|
||||
|
||||
if (this->flameScaleX > 0.0f) {
|
||||
currentMatrixState = Matrix_GetCurrentState();
|
||||
currentMatrixState = Matrix_GetCurrent();
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
Matrix_RotateY(
|
||||
Matrix_RotateYS(
|
||||
((Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) - this->actor.shape.rot.y) + 0x8000),
|
||||
MTXMODE_APPLY);
|
||||
Matrix_Scale(this->flameScaleX, this->flameScaleY, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
@@ -255,7 +255,7 @@ s32 EnBba01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
|
||||
bodyPart = gEnHyBodyParts[limbIndex];
|
||||
if (bodyPart >= 0) {
|
||||
Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
|
||||
Matrix_MultVec3f(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
|
||||
}
|
||||
|
||||
if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
|
||||
@@ -266,20 +266,20 @@ s32 EnBba01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
|
||||
Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->enHy.headRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(-this->enHy.headRot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->enHy.headRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->enHy.headRot.x, MTXMODE_APPLY);
|
||||
Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (limbIndex == BBA_LIMB_BAG) {
|
||||
Matrix_InsertXRotation_s(-this->enHy.torsoRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(-this->enHy.torsoRot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(-this->enHy.torsoRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->enHy.torsoRot.x, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if ((limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) && this->enHy.inMsgState3 &&
|
||||
((globalCtx->state.frames % 2) == 0)) {
|
||||
Matrix_InsertTranslation(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if ((limbIndex == BBA_LIMB_BAG) || (limbIndex == BBA_LIMB_TORSO) || (limbIndex == BBA_LIMB_LEFT_FOREARM)) {
|
||||
@@ -303,7 +303,7 @@ void EnBba01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
}
|
||||
|
||||
if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
|
||||
Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.actor.focus.pos);
|
||||
Matrix_MultVec3f(&zeroVec, &this->enHy.actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ void EnBba01_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
SkelAnime_DrawTransformFlexOpa(globalCtx, this->enHy.skelAnime.skeleton, this->enHy.skelAnime.jointTable,
|
||||
this->enHy.skelAnime.dListCount, EnBba01_OverrideLimbDraw, EnBba01_PostLimbDraw,
|
||||
EnBba01_TransformLimbDraw, &this->enHy.actor);
|
||||
Matrix_InsertXRotation_s(0, MTXMODE_NEW);
|
||||
Matrix_RotateXS(0, MTXMODE_NEW);
|
||||
|
||||
for (i = 0, shadowTexIter = shadowTex; i < SUBS_SHADOW_TEX_SIZE; i++) {
|
||||
*shadowTexIter++ = 0;
|
||||
|
||||
@@ -674,17 +674,17 @@ void EnBbfall_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
if (this->bodyPartDrawStatus == BBFALL_BODY_PART_DRAW_STATUS_ALIVE) {
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] == 0) {
|
||||
Matrix_GetStateTranslationAndScaledX(1000.0f, &this->bodyPartsPos[0]);
|
||||
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[0]);
|
||||
} else if (sLimbIndexToBodyPartsIndex[limbIndex] == 3) {
|
||||
Matrix_GetStateTranslationAndScaledX(-1000.0f, &this->bodyPartsPos[3]);
|
||||
Matrix_MultiplyVector3fByState(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
|
||||
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[3]);
|
||||
Matrix_MultVec3f(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
|
||||
} else {
|
||||
Matrix_GetStateTranslation(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
}
|
||||
}
|
||||
} else if (this->bodyPartDrawStatus > BBFALL_BODY_PART_DRAW_STATUS_ALIVE) {
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
|
||||
Matrix_GetStateTranslation(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
|
||||
}
|
||||
|
||||
if (limbIndex == BUBBLE_LIMB_CRANIUM) {
|
||||
@@ -694,11 +694,11 @@ void EnBbfall_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
currentMatrixState = Matrix_GetCurrentState();
|
||||
currentMatrixState = Matrix_GetCurrent();
|
||||
currentMatrixState->mf[3][0] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].x;
|
||||
currentMatrixState->mf[3][1] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].y;
|
||||
currentMatrixState->mf[3][2] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].z;
|
||||
Matrix_InsertZRotation_s(thisx->world.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(thisx->world.rot.z, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, this->limbDList);
|
||||
@@ -727,12 +727,12 @@ void EnBbfall_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
|
||||
if (this->flameOpacity > 0) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
Matrix_RotateY(
|
||||
Matrix_RotateYS(
|
||||
((Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) - this->actor.shape.rot.y) + 0x8000),
|
||||
MTXMODE_APPLY);
|
||||
Matrix_Scale(this->flameScaleX, this->flameScaleY, 1.0f, MTXMODE_APPLY);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
|
||||
currentMatrixState = Matrix_GetCurrentState();
|
||||
currentMatrixState = Matrix_GetCurrent();
|
||||
|
||||
opacity = this->flameOpacity;
|
||||
pos = &this->flamePos[0];
|
||||
|
||||
@@ -636,12 +636,12 @@ void EnBigokuta_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
|
||||
if (limbPosIndex != -1) {
|
||||
if (limbPosIndex < 6) {
|
||||
Matrix_GetStateTranslationAndScaledX(800.0f, &this->limbPos[limbPosIndex]);
|
||||
Matrix_MultVecX(800.0f, &this->limbPos[limbPosIndex]);
|
||||
} else if (limbPosIndex < 8) {
|
||||
Matrix_GetStateTranslation(&this->limbPos[limbPosIndex]);
|
||||
Matrix_MultZero(&this->limbPos[limbPosIndex]);
|
||||
} else {
|
||||
for (i = 0; i < ARRAY_COUNT(D_80AC45D0); i++) {
|
||||
Matrix_MultiplyVector3fByState(&D_80AC45D0[i], &this->limbPos[limbPosIndex + i]);
|
||||
Matrix_MultVec3f(&D_80AC45D0[i], &this->limbPos[limbPosIndex + i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,9 +734,9 @@ void EnBigpo_BurnAwayDeath(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
void EnBigpo_SetupLanternDrop(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
this->actor.draw = EnBigpo_DrawLantern;
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
this->actor.world.pos.x = this->drawMtxF.wx;
|
||||
this->actor.world.pos.y = this->drawMtxF.wy;
|
||||
this->actor.world.pos.z = this->drawMtxF.wz;
|
||||
this->actor.world.pos.x = this->drawMtxF.xw;
|
||||
this->actor.world.pos.y = this->drawMtxF.yw;
|
||||
this->actor.world.pos.z = this->drawMtxF.zw;
|
||||
|
||||
Actor_SetScale(&this->actor, 0.014f);
|
||||
this->actor.gravity = -1.0f;
|
||||
@@ -1249,31 +1249,31 @@ void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
|
||||
if (limbIndex == 7) {
|
||||
// we scale the vec3f... then do nothing with it?
|
||||
Matrix_GetStateTranslationAndScaledY(1400.0f, &unusedVec);
|
||||
Matrix_MultVecY(1400.0f, &unusedVec);
|
||||
if ((this->actionFunc == EnBigpo_BurnAwayDeath) && (this->idleTimer > 18)) {
|
||||
if (this->actor.scale.x != 0.0f) {
|
||||
Matrix_Scale(0.014f / this->actor.scale.x, 0.014f / this->actor.scale.x, 0.014f / this->actor.scale.x,
|
||||
1);
|
||||
}
|
||||
}
|
||||
Matrix_CopyCurrentState(&this->drawMtxF);
|
||||
Matrix_Get(&this->drawMtxF);
|
||||
}
|
||||
|
||||
limbByte = D_80B65078[limbIndex];
|
||||
if (limbByte != -1) {
|
||||
if (limbByte < 3) {
|
||||
Matrix_GetStateTranslation(&this->limbPos[limbByte]);
|
||||
Matrix_MultZero(&this->limbPos[limbByte]);
|
||||
} else if (limbByte == 3) {
|
||||
Matrix_GetStateTranslationAndScaledX(3000.0f, &this->limbPos[limbByte]);
|
||||
Matrix_MultVecX(3000.0f, &this->limbPos[limbByte]);
|
||||
} else if (limbByte == 4) {
|
||||
Matrix_GetStateTranslationAndScaledY(-2000.0f, &this->limbPos[limbByte]);
|
||||
Matrix_MultVecY(-2000.0f, &this->limbPos[limbByte]);
|
||||
} else {
|
||||
v2ptr = &this->limbPos[limbByte + 1];
|
||||
v1ptr = D_80B65084;
|
||||
Matrix_GetStateTranslationAndScaledX(-4000.0f, &this->limbPos[limbByte]);
|
||||
Matrix_MultVecX(-4000.0f, &this->limbPos[limbByte]);
|
||||
|
||||
for (i = limbByte + 1; i < ARRAY_COUNT(this->limbPos); i++) {
|
||||
Matrix_MultiplyVector3fByState(v1ptr, v2ptr);
|
||||
Matrix_MultVec3f(v1ptr, v2ptr);
|
||||
v2ptr++;
|
||||
v1ptr++;
|
||||
}
|
||||
@@ -1315,7 +1315,7 @@ void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.scale.x * 71.428566f * this->drawDmgEffScale, 0.0f, this->drawDmgEffAlpha,
|
||||
ACTOR_DRAW_DMGEFF_LIGHT_ORBS);
|
||||
|
||||
Matrix_SetCurrentState(&this->drawMtxF);
|
||||
Matrix_Put(&this->drawMtxF);
|
||||
EnBigpo_DrawLantern(&this->actor, globalCtx);
|
||||
if (this->actionFunc == EnBigpo_SpawnCutsceneStage6) {
|
||||
EnBigpo_DrawCircleFlames(&this->actor, globalCtx);
|
||||
@@ -1344,7 +1344,7 @@ void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.world.pos.z, this->mainColor.r, this->mainColor.g, this->mainColor.b,
|
||||
this->mainColor.a * 2);
|
||||
|
||||
Matrix_RotateY(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
|
||||
Matrix_RotateYS(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -1386,7 +1386,7 @@ void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
gSPSegment(&dispHead[1], 0x0A, Gfx_EnvColor(globalCtx->state.gfxCtx, 160, 0, 255, this->mainColor.a));
|
||||
|
||||
Matrix_GetStateTranslationAndScaledY(1400.0f, &vec2);
|
||||
Matrix_MultVecY(1400.0f, &vec2);
|
||||
Lights_PointGlowSetInfo(&this->fires[0].info, vec2.x + vec1.x, vec2.y + vec1.y, vec2.z + vec1.z,
|
||||
this->lanternColor.r, this->lanternColor.g, this->lanternColor.b, this->lanternColor.a);
|
||||
|
||||
@@ -1415,11 +1415,11 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {
|
||||
MtxF* mtfxPtr;
|
||||
s32 i;
|
||||
|
||||
mtfxPtr = Matrix_GetCurrentState();
|
||||
mtfxPtr = Matrix_GetCurrent();
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
Matrix_RotateY(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_NEW);
|
||||
Matrix_RotateYS(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_NEW);
|
||||
if (this->actionFunc == EnBigpo_SpawnCutsceneStage6) {
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
fireRadius = 500;
|
||||
@@ -1439,9 +1439,9 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Lights_PointNoGlowSetInfo(&this->fires[i].info, this->fires[i].pos.x, this->fires[i].pos.y,
|
||||
this->fires[i].pos.z, 170, 255, 255, fireRadius);
|
||||
mtfxPtr->wx = firePtr->pos.x;
|
||||
mtfxPtr->wy = firePtr->pos.y;
|
||||
mtfxPtr->wz = firePtr->pos.z;
|
||||
mtfxPtr->xw = firePtr->pos.x;
|
||||
mtfxPtr->yw = firePtr->pos.y;
|
||||
mtfxPtr->zw = firePtr->pos.z;
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
|
||||
@@ -2873,35 +2873,35 @@ void EnBigslime_UpdateGekko(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnBigslime_SetSysMatrix(Vec3f* pos, GlobalContext* globalCtx, Gfx* shadowDList, f32 scaleX, f32 scalez, f32 scaleY,
|
||||
s16 rotation, f32 alpha) {
|
||||
f32 yDistMinY;
|
||||
f32 xz;
|
||||
MtxF* sysMatrix = Matrix_GetCurrentState();
|
||||
f32 zx;
|
||||
MtxF* sysMatrix = Matrix_GetCurrent();
|
||||
|
||||
yDistMinY = pos->y - scaleY - GBT_ROOM_5_MIN_Y;
|
||||
yDistMinY = CLAMP((yDistMinY), 0.0f, (GBT_ROOM_5_CENTER_Y - GBT_ROOM_5_MIN_Y) / 2);
|
||||
xz = 1.0f - (yDistMinY * (1.0f / 1550.0f));
|
||||
zx = 1.0f - (yDistMinY * (1.0f / 1550.0f));
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP, 0x2C);
|
||||
sysMatrix->xx = xz;
|
||||
sysMatrix->xx = zx;
|
||||
sysMatrix->yy = 1.0f;
|
||||
sysMatrix->zz = xz;
|
||||
sysMatrix->xz = sysMatrix->xy = 0.0f;
|
||||
sysMatrix->yz = sysMatrix->yx = 0.0f;
|
||||
sysMatrix->zy = sysMatrix->zx = 0.0f;
|
||||
sysMatrix->wx = pos->x;
|
||||
sysMatrix->wy = GBT_ROOM_5_MIN_Y;
|
||||
sysMatrix->wz = pos->z;
|
||||
sysMatrix->xw = sysMatrix->yw = sysMatrix->zw = 0.0f;
|
||||
sysMatrix->zz = zx;
|
||||
sysMatrix->zx = sysMatrix->yx = 0.0f;
|
||||
sysMatrix->zy = sysMatrix->xy = 0.0f;
|
||||
sysMatrix->yz = sysMatrix->xz = 0.0f;
|
||||
sysMatrix->xw = pos->x;
|
||||
sysMatrix->yw = GBT_ROOM_5_MIN_Y;
|
||||
sysMatrix->zw = pos->z;
|
||||
sysMatrix->wx = sysMatrix->wy = sysMatrix->wz = 0.0f;
|
||||
sysMatrix->ww = 1.0f;
|
||||
|
||||
Matrix_RotateY(rotation, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(rotation, MTXMODE_APPLY);
|
||||
Matrix_Scale(scaleX, 1.0f, scalez, MTXMODE_APPLY);
|
||||
if (shadowDList != gBigslimeShadowDL) {
|
||||
gDPSetCombineLERP(POLY_OPA_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0,
|
||||
COMBINED);
|
||||
}
|
||||
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u8)(alpha * xz));
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u8)(alpha * zx));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, shadowDList);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -2940,14 +2940,14 @@ void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx2) {
|
||||
Lights_Draw(lights, globalCtx->state.gfxCtx);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
func_800B8118(&minislime->actor, globalCtx, 0);
|
||||
Matrix_SetStateRotationAndTranslation(minislime->actor.world.pos.x, minislime->actor.world.pos.y,
|
||||
minislime->actor.world.pos.z, &minislime->actor.shape.rot);
|
||||
Matrix_SetTranslateRotateYXZ(minislime->actor.world.pos.x, minislime->actor.world.pos.y,
|
||||
minislime->actor.world.pos.z, &minislime->actor.shape.rot);
|
||||
Matrix_Scale(minislime->actor.scale.x, minislime->actor.scale.y, minislime->actor.scale.z, MTXMODE_APPLY);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, minislime->actor.shape.shadowAlpha);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, &gMinislimeNormalDL);
|
||||
if (minislime->frozenAlpha > 0) {
|
||||
Matrix_InsertTranslation(0.0f, (0.1f - minislime->frozenScale) * -4000.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, (0.1f - minislime->frozenScale) * -4000.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.1f, minislime->frozenScale, 0.1f, MTXMODE_APPLY);
|
||||
AnimatedMat_Draw(globalCtx, this->minislimeFrozenTexAnim);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, minislime->frozenAlpha);
|
||||
@@ -2999,18 +2999,18 @@ void EnBigslime_DrawBigslime(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
// Draw bubbles inside Bigslime
|
||||
if (this->actor.scale.x > 0.0f) {
|
||||
Matrix_SetCurrentState(&globalCtx->billboardMtxF);
|
||||
Matrix_Put(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(0.0050000003f, 0.0050000003f, 0.0050000003f, MTXMODE_APPLY);
|
||||
billboardMtxF = Matrix_GetCurrentState();
|
||||
billboardMtxF = Matrix_GetCurrent();
|
||||
|
||||
for (i = 0; i < 28; i++) {
|
||||
bubblesInfoPtr = &bubblesInfo[i];
|
||||
dynamicVtx = &sBigslimeDynamicVtx[this->dynamicVtxState][bubblesInfoPtr->v];
|
||||
billboardMtxF->wx =
|
||||
billboardMtxF->xw =
|
||||
dynamicVtx->n.ob[0] * this->actor.scale.x * bubblesInfoPtr->scaleVtx + this->actor.world.pos.x;
|
||||
billboardMtxF->wy =
|
||||
billboardMtxF->yw =
|
||||
dynamicVtx->n.ob[1] * this->actor.scale.y * bubblesInfoPtr->scaleVtx + this->actor.world.pos.y;
|
||||
billboardMtxF->wz =
|
||||
billboardMtxF->zw =
|
||||
dynamicVtx->n.ob[2] * this->actor.scale.z * bubblesInfoPtr->scaleVtx + this->actor.world.pos.z;
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -3048,16 +3048,16 @@ void EnBigslime_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
Vec3f rightFootOffset;
|
||||
|
||||
if (limbIndex == GEKKO_LIMB_HEAD) {
|
||||
Matrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
Matrix_MultZero(&this->actor.focus.pos);
|
||||
this->actor.focus.rot.y = this->gekkoRot.y;
|
||||
}
|
||||
|
||||
if (limbPosIndex[limbIndex] != -1) {
|
||||
Matrix_GetStateTranslation(&this->limbPos[limbPosIndex[limbIndex]]);
|
||||
Matrix_MultZero(&this->limbPos[limbPosIndex[limbIndex]]);
|
||||
}
|
||||
|
||||
if (limbIndex == GEKKO_LIMB_R_ANKLE) {
|
||||
Matrix_MultiplyVector3fByState(&rightFootOffsetRef, &rightFootOffset);
|
||||
Matrix_MultVec3f(&rightFootOffsetRef, &rightFootOffset);
|
||||
this->gekkoCollider.dim.pos.y = rightFootOffset.y;
|
||||
}
|
||||
}
|
||||
@@ -3087,7 +3087,7 @@ void EnBigslime_DrawGekko(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Math_Vec3f_Sum(&this->actor.world.pos, &this->gekkoPosOffset, &gekkoPos);
|
||||
Matrix_SetStateRotationAndTranslation(gekkoPos.x, gekkoPos.y, gekkoPos.z, &this->gekkoRot);
|
||||
Matrix_SetTranslateRotateYXZ(gekkoPos.x, gekkoPos.y, gekkoPos.z, &this->gekkoRot);
|
||||
Matrix_Scale(this->gekkoScale, this->gekkoScale, this->gekkoScale, MTXMODE_APPLY);
|
||||
SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &gekkoPos, &this->gekkoProjectedPos);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -3131,7 +3131,7 @@ void EnBigslime_DrawShatteringEffects(EnBigslime* this, GlobalContext* globalCtx
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, globalCtx->gameplayFrames % 128,
|
||||
(u8)(globalCtx->gameplayFrames * 8), 32, 64, 1,
|
||||
(-globalCtx->gameplayFrames * 2) % 64, 0, 16, 16));
|
||||
Matrix_InsertTranslation(this->frozenPos.x, this->frozenPos.y, this->frozenPos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(this->frozenPos.x, this->frozenPos.y, this->frozenPos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->shockwaveScale, this->shockwaveScale, this->shockwaveScale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, &gBigslimeShockwaveDL);
|
||||
@@ -3144,8 +3144,8 @@ void EnBigslime_DrawShatteringEffects(EnBigslime* this, GlobalContext* globalCtx
|
||||
for (i = 0; i < BIGSLIME_NUM_ICE_SHARD; i++) {
|
||||
iceShardEffect = &this->iceShardEffect[i];
|
||||
if (iceShardEffect->isActive > false) {
|
||||
Matrix_SetStateRotationAndTranslation(iceShardEffect->pos.x, iceShardEffect->pos.y, iceShardEffect->pos.z,
|
||||
&iceShardEffect->rotation);
|
||||
Matrix_SetTranslateRotateYXZ(iceShardEffect->pos.x, iceShardEffect->pos.y, iceShardEffect->pos.z,
|
||||
&iceShardEffect->rotation);
|
||||
Matrix_Scale(iceShardEffect->scale, iceShardEffect->scale, iceShardEffect->scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -97,7 +97,7 @@ typedef struct EnBigslime {
|
||||
/* 0x02C4 */ s16 numGekkoPosGrabPlayer; // The Gekko will melee-attack link at 6 positions while engulfed in bigslime
|
||||
/* 0x02C6 */ s16 subCamId;
|
||||
/* 0x02C8 */ s16 subCamYawGrabPlayer;
|
||||
/* 0x02CA */ s16 rotation; // is always 0, used in Matrix_RotateY
|
||||
/* 0x02CA */ s16 rotation; // is always 0, used in Matrix_RotateYS
|
||||
/* 0x02CC */ s16 itemDropTimer; // items only drop when zero, Set to 40 then decrements, prevents itemDrop spam
|
||||
/* 0x02CE */ Vec3s gekkoRot;
|
||||
/* 0x02D4 */ Vec3f gekkoPosOffset; // Used when Bigslime grabs link
|
||||
|
||||
@@ -428,7 +428,7 @@ void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
sp20.x += temp_f4 * 0.1f;
|
||||
sp20.y += temp_f4 * 0.1f;
|
||||
sp20.z += temp_f4 * 0.1f;
|
||||
Matrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&sp20, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -383,8 +383,8 @@ void func_808715B8(EnBom* this, GlobalContext* globalCtx) {
|
||||
spCC = Rand_ZeroFloat(M_PI);
|
||||
|
||||
for (i = 0; i < 15; i++) {
|
||||
Matrix_InsertYRotation_f(((2.0f * (i * M_PI)) / 15.0f) + spCC, MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ((10 - this->timer) * 300.0f * 0.1f, &spC0);
|
||||
Matrix_RotateYF(((2.0f * (i * M_PI)) / 15.0f) + spCC, MTXMODE_NEW);
|
||||
Matrix_MultVecZ((10 - this->timer) * 300.0f * 0.1f, &spC0);
|
||||
spB4.x = this->actor.world.pos.x + spC0.x;
|
||||
spB4.y = this->actor.world.pos.y + 500.0f;
|
||||
spB4.z = this->actor.world.pos.z + spC0.z;
|
||||
@@ -400,7 +400,7 @@ void func_808715B8(EnBom* this, GlobalContext* globalCtx) {
|
||||
sp84 = D_80872E94;
|
||||
sp80 = D_80872E94;
|
||||
}
|
||||
Matrix_GetStateTranslationAndScaledZ(5.0f, &sp94);
|
||||
Matrix_MultVecZ(5.0f, &sp94);
|
||||
sp88.x = sp88.z = 0.0f;
|
||||
sp94.y = 2.0f;
|
||||
sp88.y = 0.2f;
|
||||
@@ -606,14 +606,14 @@ void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (!this->isPowderKeg) {
|
||||
func_800B8050(&this->actor, globalCtx, 0);
|
||||
Matrix_MultiplyVector3fByState(&D_80872EE0, &this->actor.home.pos);
|
||||
Matrix_MultVec3f(&D_80872EE0, &this->actor.home.pos);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_015FA0);
|
||||
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_InsertXRotation_s(0x4000, MTXMODE_APPLY);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_RotateXS(0x4000, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -629,15 +629,15 @@ void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s16 sp4A = this->actor.world.rot.y - this->actor.shape.rot.y;
|
||||
f32 sp44 = (1000.0f / Math_CosS(ABS_ALT((s16)(this->unk_1FA % 10922)) - 0x1555)) + -1000.0f;
|
||||
|
||||
Matrix_RotateY(sp4A, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, sp44, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_1FA, MTXMODE_APPLY);
|
||||
Matrix_RotateY(-sp4A, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(sp4A, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, sp44, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1FA, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(-sp4A, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
Matrix_MultiplyVector3fByState(&D_80872EEC, &this->actor.home.pos);
|
||||
Matrix_MultiplyVector3fByState(&D_80872EF8, &sp58);
|
||||
Matrix_MultiplyVector3fByState(&D_80872F04, &sp4C);
|
||||
Matrix_MultVec3f(&D_80872EEC, &this->actor.home.pos);
|
||||
Matrix_MultVec3f(&D_80872EF8, &sp58);
|
||||
Matrix_MultVec3f(&D_80872F04, &sp4C);
|
||||
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
@@ -776,8 +776,8 @@ void func_80872BC0(GlobalContext* globalCtx, s32 arg1) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_InsertRotation(ptr->unk_1A, ptr->unk_18, 0, MTXMODE_APPLY);
|
||||
Matrix_Translate(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(ptr->unk_1A, ptr->unk_18, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -787,8 +787,8 @@ void func_80872BC0(GlobalContext* globalCtx, s32 arg1) {
|
||||
ptr2 = &D_80874650[1];
|
||||
|
||||
for (i = 1; i < temp_s5; i++, ptr2++) {
|
||||
Matrix_InsertTranslation(ptr2->unk_00.x, ptr2->unk_00.y, ptr2->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_InsertRotation(ptr2->unk_1A, ptr2->unk_18, 0, MTXMODE_APPLY);
|
||||
Matrix_Translate(ptr2->unk_00.x, ptr2->unk_00.y, ptr2->unk_00.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(ptr2->unk_1A, ptr2->unk_18, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -136,8 +136,8 @@ s32 EnBomChu_UpdateFloorPoly(EnBomChu* this, CollisionPoly* floorPoly, GlobalCon
|
||||
}
|
||||
|
||||
Math_Vec3f_Scale(&vec, 1.0f / magnitude);
|
||||
Matrix_InsertRotationAroundUnitVector_f(angle, &vec, MTXMODE_NEW);
|
||||
Matrix_MultiplyVector3fByState(&this->axisLeft, &vec);
|
||||
Matrix_RotateAxisF(angle, &vec, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&this->axisLeft, &vec);
|
||||
Math_Vec3f_Copy(&this->axisLeft, &vec);
|
||||
Math3D_CrossProduct(&this->axisLeft, &normal, &this->axisForwards);
|
||||
|
||||
@@ -156,18 +156,18 @@ void EnBomChu_UpdateRotation(EnBomChu* this) {
|
||||
MtxF mf;
|
||||
|
||||
mf.xx = this->axisLeft.x;
|
||||
mf.xy = this->axisLeft.y;
|
||||
mf.xz = this->axisLeft.z;
|
||||
mf.yx = this->axisLeft.y;
|
||||
mf.zx = this->axisLeft.z;
|
||||
|
||||
mf.yx = this->axisUp.x;
|
||||
mf.xy = this->axisUp.x;
|
||||
mf.yy = this->axisUp.y;
|
||||
mf.yz = this->axisUp.z;
|
||||
mf.zy = this->axisUp.z;
|
||||
|
||||
mf.zx = this->axisForwards.x;
|
||||
mf.zy = this->axisForwards.y;
|
||||
mf.xz = this->axisForwards.x;
|
||||
mf.yz = this->axisForwards.y;
|
||||
mf.zz = this->axisForwards.z;
|
||||
|
||||
func_8018219C(&mf, &this->actor.world.rot, 0);
|
||||
Matrix_MtxFToYXZRot(&mf, &this->actor.world.rot, false);
|
||||
this->actor.world.rot.x = -this->actor.world.rot.x;
|
||||
}
|
||||
|
||||
@@ -205,13 +205,13 @@ s32 EnBomChu_IsOnCollisionPoly(GlobalContext* globalCtx, Vec3f* posA, Vec3f* pos
|
||||
void EnBomChu_SetupMove(EnBomChu* this) {
|
||||
func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot);
|
||||
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
|
||||
Matrix_GetStateTranslationAndScaledY(1.0f, &this->axisUp);
|
||||
Matrix_GetStateTranslationAndScaledZ(1.0f, &this->axisForwards);
|
||||
Matrix_GetStateTranslationAndScaledX(1.0f, &this->axisLeft);
|
||||
Matrix_MultVecY(1.0f, &this->axisUp);
|
||||
Matrix_MultVecZ(1.0f, &this->axisForwards);
|
||||
Matrix_MultVecX(1.0f, &this->axisLeft);
|
||||
|
||||
this->actor.world.rot.x = -this->actor.shape.rot.x;
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
@@ -564,7 +564,7 @@ void EnBomChu_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
colorIntensity = blinkTime / (f32)blinkHalfPeriod;
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, (s32)(colorIntensity * 209.0f) + 9, (s32)(colorIntensity * 34.0f) + 9,
|
||||
(s32)(colorIntensity * -35.0f) + 35, 255);
|
||||
Matrix_InsertTranslation(this->visualJitter * (1.0f / BOMBCHU_SCALE), 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->visualJitter * (1.0f / BOMBCHU_SCALE), 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gBombchuDL);
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ Gfx* func_808AF86C(GraphicsContext* gfxCtx, GlobalContext* globalCtx) {
|
||||
Gfx* head = GRAPH_ALLOC(gfxCtx, sizeof(Gfx) * 6);
|
||||
Gfx* gfx = head;
|
||||
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
|
||||
gSPMatrix(gfx++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPEndDisplayList(gfx++);
|
||||
@@ -473,7 +473,7 @@ void EnBombf_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_bombf_DL_000340);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_bombf_DL_000530);
|
||||
|
||||
Matrix_InsertTranslation(0.0f, 1000.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 1000.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->unk_204, this->unk_204, this->unk_204, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
|
||||
@@ -325,19 +325,18 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_RotateY(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
|
||||
Matrix_InsertZRotation_s((this->actor.params != 0) ? 0x1F40 : -0x1F40, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_MultiplyVector3fByState(&sp58->unk_04, &sp4C);
|
||||
Matrix_MultiplyVector3fByState(&sp58->unk_10, &sp40);
|
||||
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS((this->actor.params != 0) ? 0x1F40 : -0x1F40, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_MultVec3f(&sp58->unk_04, &sp4C);
|
||||
Matrix_MultVec3f(&sp58->unk_10, &sp40);
|
||||
|
||||
if (func_80126440(globalCtx, &this->collider, &this->weaponInfo, &sp4C, &sp40)) {
|
||||
EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &sp4C, &sp40);
|
||||
}
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
Matrix_RotateY(this->unk_1CD * 0x2EE0, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->unk_1CD * 0x2EE0, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sp58->unk_00);
|
||||
|
||||
@@ -53,10 +53,10 @@ void EnBu_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateZS(this->actor.shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, this->displayListPtr);
|
||||
|
||||
@@ -144,12 +144,12 @@ void func_8091C178(EnButte* this, GlobalContext* globalCtx) {
|
||||
sp48 = CLAMP(sp48, 0, 255);
|
||||
|
||||
func_800DFC90(&sp40, GET_ACTIVE_CAM(globalCtx));
|
||||
Matrix_RotateY(sp40.y, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(sp40.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(sp40.z, MTXMODE_APPLY);
|
||||
Matrix_MultiplyVector3fByState(&D_8091D3A4, &sp4C);
|
||||
Matrix_SetStateRotationAndTranslation(this->actor.focus.pos.x + sp4C.x, this->actor.focus.pos.y + sp4C.y,
|
||||
this->actor.focus.pos.z + sp4C.z, &sp40);
|
||||
Matrix_RotateYS(sp40.y, MTXMODE_NEW);
|
||||
Matrix_RotateXS(sp40.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(sp40.z, MTXMODE_APPLY);
|
||||
Matrix_MultVec3f(&D_8091D3A4, &sp4C);
|
||||
Matrix_SetTranslateRotateYXZ(this->actor.focus.pos.x + sp4C.x, this->actor.focus.pos.y + sp4C.y,
|
||||
this->actor.focus.pos.z + sp4C.z, &sp40);
|
||||
Matrix_Scale(D_8091D39C, D_8091D39C, D_8091D39C, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -116,7 +116,7 @@ void EnCha_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnCha* this = THIS;
|
||||
|
||||
Gfx_DrawDListOpa(globalCtx, object_cha_DL_000710);
|
||||
Matrix_InsertTranslation(-1094.0f, 4950.0f, 9.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->actor.home.rot.x, MTXMODE_APPLY);
|
||||
Matrix_Translate(-1094.0f, 4950.0f, 9.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->actor.home.rot.x, MTXMODE_APPLY);
|
||||
Gfx_DrawDListOpa(globalCtx, object_cha_DL_000958);
|
||||
}
|
||||
|
||||
@@ -427,9 +427,9 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
for (i = 0; i < 54; i++) {
|
||||
lightRayMaxScale =
|
||||
sLightRayMaxScale[thisx->params] + Rand_ZeroFloat(sLightRayMaxScale[thisx->params]);
|
||||
Matrix_InsertYRotation_f(Rand_ZeroFloat(M_PI * 2), MTXMODE_NEW);
|
||||
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(M_PI * 2));
|
||||
Matrix_GetStateTranslationAndScaledZ(lightRayMaxScale, &vel);
|
||||
Matrix_RotateYF(Rand_ZeroFloat(M_PI * 2), MTXMODE_NEW);
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(M_PI * 2));
|
||||
Matrix_MultVecZ(lightRayMaxScale, &vel);
|
||||
accel.x = vel.x * -0.03f;
|
||||
accel.y = vel.y * -0.03f;
|
||||
accel.z = vel.z * -0.03f;
|
||||
@@ -478,8 +478,8 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if (thisx->params != CLEAR_TAG_POP) {
|
||||
pos.y = this->actor.world.pos.y;
|
||||
for (i = 0; i < 18; i++) {
|
||||
vel.x = __sinf(i * (33.0f / 40.0f)) * i * .5f;
|
||||
vel.z = __cosf(i * (33.0f / 40.0f)) * i * .5f;
|
||||
vel.x = sinf(i * (33.0f / 40.0f)) * i * .5f;
|
||||
vel.z = cosf(i * (33.0f / 40.0f)) * i * .5f;
|
||||
vel.y = Rand_ZeroFloat(8.0f) + 7.0f;
|
||||
|
||||
vel.x += randPlusMinusPoint5Scaled(0.5f);
|
||||
@@ -500,9 +500,9 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
pos = this->actor.world.pos;
|
||||
for (i = 0; i < 44; i++) {
|
||||
lightRayMaxScale = sLightRayMaxScale[thisx->params] + Rand_ZeroFloat(sLightRayMaxScale[thisx->params]);
|
||||
Matrix_InsertYRotation_f(Rand_ZeroFloat(2 * M_PI), MTXMODE_NEW);
|
||||
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_GetStateTranslationAndScaledZ(lightRayMaxScale, &vel);
|
||||
Matrix_RotateYF(Rand_ZeroFloat(2 * M_PI), MTXMODE_NEW);
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_MultVecZ(lightRayMaxScale, &vel);
|
||||
accel.x = vel.x * -0.03f;
|
||||
accel.y = vel.y * -0.03f;
|
||||
accel.z = vel.z * -0.03f;
|
||||
@@ -809,10 +809,10 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
// Draw the debris effect.
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
|
||||
Matrix_InsertYRotation_f(effect->rotationY, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
Matrix_RotateYF(effect->rotationY, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(effect->rotationX);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gClearTagDebrisEffectDL);
|
||||
}
|
||||
@@ -828,7 +828,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, (s8)effect->primColor.a);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s8)effect->primColor.a);
|
||||
func_800C0094(this->actor.floorPoly, effect->position.x, effect->position.y, effect->position.z, &mtxF);
|
||||
Matrix_SetCurrentState(&mtxF);
|
||||
Matrix_Put(&mtxF);
|
||||
Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_030100);
|
||||
@@ -853,7 +853,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, (s8)(effect->primColor.a * 0.7f));
|
||||
func_800C0094(this->actor.floorPoly, effect->position.x, this->actor.floorHeight, effect->position.z,
|
||||
&mtxF);
|
||||
Matrix_SetCurrentState(&mtxF);
|
||||
Matrix_Put(&mtxF);
|
||||
Matrix_Scale(effect->scale * 3.0f, 1.0f, effect->scale * 3.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFlashEffectGroundDL);
|
||||
@@ -881,10 +881,10 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(
|
||||
POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, -effect->actionTimer * 5, 32, 64, 1, 0, 0, 32, 32));
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(effect->smokeScaleX * effect->scale, effect->smokeScaleY * effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 20.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 20.0f, 0.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFireEffectDL);
|
||||
}
|
||||
@@ -907,8 +907,8 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(
|
||||
POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, -effect->actionTimer * 15, 32, 64, 1, 0, 0, 32, 32));
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFireEffectDL);
|
||||
@@ -929,8 +929,8 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
// Draw the flash billboard effect.
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, (s8)effect->primColor.a);
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(2.0f * effect->scale, 2.0f * effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFlashEffectDL);
|
||||
@@ -954,12 +954,12 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
// Draw the light ray effect.
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (u8)effect->primColor.r, (u8)effect->primColor.g,
|
||||
(u8)effect->primColor.b, (u8)effect->primColor.a);
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_InsertYRotation_f(effect->rotationY, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
Matrix_InsertZRotation_f(effect->rotationZ, MTXMODE_APPLY);
|
||||
Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_RotateYF(effect->rotationY, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(effect->rotationX);
|
||||
Matrix_RotateZF(effect->rotationZ, MTXMODE_APPLY);
|
||||
Matrix_Scale(effect->scale * 0.5f, effect->scale * 0.5f, effect->maxScale * effect->scale, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(M_PI / 2);
|
||||
Matrix_RotateXFApply(M_PI / 2);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagLightRayEffectDL);
|
||||
}
|
||||
@@ -979,8 +979,8 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
// Apply material 16 times along a circle to give the appearance of a splash
|
||||
for (j = 0; j < 16; j++) {
|
||||
Matrix_InsertYRotation_f(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(effect->maxScale, &vec);
|
||||
Matrix_RotateYF(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_NEW);
|
||||
Matrix_MultVecZ(effect->maxScale, &vec);
|
||||
/**
|
||||
* Get the water surface at point (`x`, `ySurface`, `z`). `ySurface` doubles as position y input
|
||||
* returns true if point is within the xz boundaries of an active water box, else false
|
||||
@@ -991,10 +991,9 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
effect->position.z + vec.z, &ySurface, &waterBox)) {
|
||||
if ((effect->position.y - ySurface) < 200.0f) {
|
||||
// Draw the splash effect.
|
||||
Matrix_InsertTranslation(effect->position.x + vec.x, ySurface, effect->position.z + vec.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertYRotation_f(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
Matrix_Translate(effect->position.x + vec.x, ySurface, effect->position.z + vec.z, MTXMODE_NEW);
|
||||
Matrix_RotateYF(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(effect->rotationX);
|
||||
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gExplosionSplashDL);
|
||||
|
||||
@@ -245,7 +245,7 @@ s32 EnCne01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
|
||||
bodyPart = gEnHyBodyParts[limbIndex];
|
||||
if (bodyPart >= 0) {
|
||||
Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
|
||||
Matrix_MultVec3f(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
|
||||
}
|
||||
|
||||
if (limbIndex == CNE_LIMB_HEAD) {
|
||||
@@ -257,19 +257,19 @@ s32 EnCne01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
if (limbIndex == CNE_LIMB_HEAD) {
|
||||
Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->enHy.headRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(-this->enHy.headRot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->enHy.headRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->enHy.headRot.x, MTXMODE_APPLY);
|
||||
Matrix_Translate(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (limbIndex == CNE_LIMB_TORSO) {
|
||||
Matrix_InsertXRotation_s(-this->enHy.torsoRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(-this->enHy.torsoRot.x, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(-this->enHy.torsoRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(-this->enHy.torsoRot.x, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if ((limbIndex == CNE_LIMB_HEAD) && this->enHy.inMsgState3 && ((globalCtx->state.frames % 2) == 0)) {
|
||||
Matrix_InsertTranslation(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if ((limbIndex == CNE_LIMB_TORSO) || (limbIndex == CNE_LIMB_LEFT_UPPER_ARM) ||
|
||||
@@ -294,7 +294,7 @@ void EnCne01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
}
|
||||
|
||||
if (limbIndex == CNE_LIMB_HEAD) {
|
||||
Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.actor.focus.pos);
|
||||
Matrix_MultVec3f(&zeroVec, &this->enHy.actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ void EnCne01_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
SkelAnime_DrawTransformFlexOpa(globalCtx, this->enHy.skelAnime.skeleton, this->enHy.skelAnime.jointTable,
|
||||
this->enHy.skelAnime.dListCount, EnCne01_OverrideLimbDraw, EnCne01_PostLimbDraw,
|
||||
EnCne01_TransformLimbDraw, &this->enHy.actor);
|
||||
Matrix_InsertXRotation_s(0, MTXMODE_NEW);
|
||||
Matrix_RotateXS(0, MTXMODE_NEW);
|
||||
|
||||
for (i = 0, shadowTexIter = shadowTex; i < SUBS_SHADOW_TEX_SIZE; i++) {
|
||||
*shadowTexIter++ = 0;
|
||||
|
||||
@@ -414,7 +414,7 @@ void EnCow_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
EnCow* this = THIS;
|
||||
|
||||
if (limbIndex == COW_LIMB_HEAD) {
|
||||
Matrix_MultiplyVector3fByState(&D_8099D63C, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_8099D63C, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -551,12 +551,12 @@ void EnCrow_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
||||
EnCrow* this = (EnCrow*)thisx;
|
||||
|
||||
if (limbIndex == OBJECT_CROW_LIMB_BODY) {
|
||||
Matrix_GetStateTranslationAndScaledX(2500.0f, this->bodyPartsPos);
|
||||
Matrix_MultVecX(2500.0f, this->bodyPartsPos);
|
||||
return;
|
||||
}
|
||||
if ((limbIndex == OBJECT_CROW_LIMB_RIGHT_WING_TIP) || (limbIndex == OBJECT_CROW_LIMB_LEFT_WING_TIP) ||
|
||||
(limbIndex == OBJECT_CROW_LIMB_TAIL)) {
|
||||
Matrix_GetStateTranslation(&this->bodyPartsPos[(limbIndex >> 1) - 1]);
|
||||
Matrix_MultZero(&this->bodyPartsPos[(limbIndex >> 1) - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) {
|
||||
isDisplayListSet = true;
|
||||
}
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
alpha = (particle->unk_02 / (f32)particle->unk_01);
|
||||
alpha *= 255.0f;
|
||||
@@ -85,15 +85,15 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) {
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (particle->unk_02 + (i * 3)) * 3,
|
||||
(particle->unk_02 + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20));
|
||||
|
||||
Matrix_InsertTranslation(particle->unk_10.x, particle->unk_10.y, particle->unk_10.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(particle->unk_10.x, particle->unk_10.y, particle->unk_10.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(particle->unk_34, particle->unk_34, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_0002E8);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ s32 EnDai_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
}
|
||||
|
||||
if (limbIndex == 11) {
|
||||
Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->unk_1E4);
|
||||
Matrix_MultVec3f(&gZeroVec3f, &this->unk_1E4);
|
||||
}
|
||||
|
||||
if (limbIndex == 10) {
|
||||
@@ -602,15 +602,15 @@ void EnDai_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
D_80B3FE4C.x = sREG(0);
|
||||
D_80B3FE4C.y = sREG(1);
|
||||
D_80B3FE4C.z = sREG(2);
|
||||
Matrix_MultiplyVector3fByState(&D_80B3FE4C, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&D_80B3FE4C, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
Matrix_CopyCurrentState(&sp24);
|
||||
func_8018219C(&sp24, &sp64, 0);
|
||||
Matrix_Get(&sp24);
|
||||
Matrix_MtxFToYXZRot(&sp24, &sp64, false);
|
||||
this->unk_1D4 = BINANG_SUB(sp64.y, 0x4000);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
Matrix_CopyCurrentState(&this->unk_18C);
|
||||
Matrix_Get(&this->unk_18C);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -662,7 +662,7 @@ void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) {
|
||||
this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
|
||||
EnDai_TransformLimbDraw, &this->actor, POLY_XLU_DISP);
|
||||
if (this->unk_1CE & 0x40) {
|
||||
Matrix_SetCurrentState(&this->unk_18C);
|
||||
Matrix_Put(&this->unk_18C);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_00C538);
|
||||
@@ -694,7 +694,7 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
|
||||
POLY_OPA_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
|
||||
EnDai_TransformLimbDraw, &this->actor, POLY_OPA_DISP);
|
||||
Matrix_SetCurrentState(&this->unk_18C);
|
||||
Matrix_Put(&this->unk_18C);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_dai_DL_00C538);
|
||||
@@ -713,7 +713,7 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
|
||||
POLY_XLU_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
|
||||
EnDai_TransformLimbDraw, &this->actor, POLY_XLU_DISP);
|
||||
Matrix_SetCurrentState(&this->unk_18C);
|
||||
Matrix_Put(&this->unk_18C);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_00C538);
|
||||
|
||||
@@ -549,17 +549,17 @@ void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) {
|
||||
if (particle->isEnabled) {
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(particle->unk_04.x, particle->unk_04.y, particle->unk_04.z, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(particle->unk_28.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(particle->unk_28.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(particle->unk_28.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
Matrix_Translate(particle->unk_04.x, particle->unk_04.y, particle->unk_04.z, MTXMODE_NEW);
|
||||
Matrix_RotateXS(particle->unk_28.x, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(particle->unk_28.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(particle->unk_28.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(particle->unk_30, particle->unk_30, particle->unk_30, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_bombiwa_DL_0009E0);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,20 +710,20 @@ void EnDekunuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
|
||||
|
||||
if (value != -1) {
|
||||
if (value < 3) {
|
||||
Matrix_GetStateTranslationAndScaledX(1000.0f, &this->limbPos[value]);
|
||||
Matrix_MultVecX(1000.0f, &this->limbPos[value]);
|
||||
} else {
|
||||
Matrix_GetStateTranslation(&this->limbPos[value]);
|
||||
Matrix_MultZero(&this->limbPos[value]);
|
||||
ptr1 = &D_808BEFA4[0];
|
||||
ptr2 = &this->limbPos[value + 1];
|
||||
for (i = value + 1; i < ARRAY_COUNT(this->limbPos); i++) {
|
||||
Matrix_MultiplyVector3fByState(ptr1, ptr2);
|
||||
Matrix_MultVec3f(ptr1, ptr2);
|
||||
ptr1++, ptr2++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (limbIndex == DEKU_SCRUB_LIMB_HEAD) {
|
||||
Matrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
Matrix_MultZero(&this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -732,8 +732,8 @@ void EnDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDekunuts_OverrideLimbDraw,
|
||||
EnDekunuts_PostLimbDraw, &this->actor);
|
||||
Matrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
if (this->actor.colorFilterTimer != 0) {
|
||||
func_800AE5A0(globalCtx);
|
||||
|
||||
@@ -202,8 +202,8 @@ void func_8098933C(EnDg* this, Vec3f* arg1) {
|
||||
sp20 = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y);
|
||||
sp1C = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z);
|
||||
|
||||
__sinf(0.0f);
|
||||
__cosf(0.0f);
|
||||
sinf(0.0f);
|
||||
cosf(0.0f);
|
||||
arg1->x = -Math_Acot2F(1.0f, -sp1C * sp20);
|
||||
arg1->z = Math_Acot2F(1.0f, -sp24 * sp20);
|
||||
}
|
||||
@@ -1190,9 +1190,9 @@ void EnDg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
if (limbIndex == DOG_LIMB_HEAD) {
|
||||
if (this->actionFunc == func_8098BBEC) {
|
||||
sp20.x = 5000.0f;
|
||||
Matrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&sp20, &this->actor.focus.pos);
|
||||
} else if (this->actionFunc != func_8098BC54) {
|
||||
Matrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
Matrix_MultVec3f(&sp20, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1236,10 +1236,10 @@ void EnDg_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateStateAroundXAxis(this->unk_294.x);
|
||||
Matrix_InsertZRotation_f(this->unk_294.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateXFApply(this->unk_294.x);
|
||||
Matrix_RotateZF(this->unk_294.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnDg_OverrideLimbDraw, EnDg_PostLimbDraw, &this->actor);
|
||||
|
||||
@@ -1429,15 +1429,15 @@ void func_8089DC84(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
|
||||
Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
|
||||
if (D_8089E3B0[limbIndex] != -1) {
|
||||
Matrix_GetStateTranslation(&this->limbPos[D_8089E3B0[limbIndex]]);
|
||||
Matrix_MultZero(&this->limbPos[D_8089E3B0[limbIndex]]);
|
||||
}
|
||||
|
||||
if ((limbIndex == 14) && (this->unk_292 != this->unk_290) &&
|
||||
((this->actionFunc == func_8089C56C) || (this->actionFunc == func_8089C2A8))) {
|
||||
Math_Vec3f_Copy(&sp74, &this->colliderQuad.dim.quad[0]);
|
||||
Math_Vec3f_Copy(&sp80, &this->colliderQuad.dim.quad[1]);
|
||||
Matrix_MultiplyVector3fByState(&D_8089E38C, &sp68);
|
||||
Matrix_MultiplyVector3fByState(&D_8089E398, &sp5C);
|
||||
Matrix_MultVec3f(&D_8089E38C, &sp68);
|
||||
Matrix_MultVec3f(&D_8089E398, &sp5C);
|
||||
Collider_SetQuadVertices(&this->colliderQuad, &sp5C, &sp68, &sp74, &sp80);
|
||||
if (this->colliderQuad.base.atFlags & AT_ON) {
|
||||
EffectBlure_AddVertex(Effect_GetByIndex(this->unk_2A0), &sp68, &sp5C);
|
||||
@@ -1446,18 +1446,18 @@ void func_8089DC84(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
}
|
||||
|
||||
if (limbIndex == 4) {
|
||||
Matrix_GetStateTranslationAndScaledX(300.0f, &this->actor.shape.feetPos[0]);
|
||||
Matrix_MultVecX(300.0f, &this->actor.shape.feetPos[0]);
|
||||
} else if (limbIndex == 7) {
|
||||
Matrix_GetStateTranslationAndScaledX(300.0f, &this->actor.shape.feetPos[1]);
|
||||
Matrix_MultVecX(300.0f, &this->actor.shape.feetPos[1]);
|
||||
}
|
||||
|
||||
if ((limbIndex == 16) && (this->actionFunc == func_8089B580)) {
|
||||
if ((this->skelAnime.curFrame > 38.0f) && (this->skelAnime.curFrame <= 55.0f) &&
|
||||
(this->unk_292 != this->unk_290)) {
|
||||
sp48 = Matrix_GetCurrentState();
|
||||
sp48 = Matrix_GetCurrent();
|
||||
sp58 = 48 - (s32)this->skelAnime.curFrame;
|
||||
sp58 = CLAMP_MIN(sp58, 0);
|
||||
Matrix_MultiplyVector3fByState(&D_8089E3A4, &sp4C);
|
||||
Matrix_MultVec3f(&D_8089E3A4, &sp4C);
|
||||
sp4C.x -= sp48->mf[3][0];
|
||||
sp4C.y -= sp48->mf[3][1];
|
||||
sp4C.z -= sp48->mf[3][2];
|
||||
|
||||
@@ -159,17 +159,17 @@ void func_80A50510(EnDnb* this, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++) {
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y, this->particles[i].unk_0C.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->particles[i].unk_18.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
Matrix_Translate(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y, this->particles[i].unk_0C.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->particles[i].unk_18.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gfx[i]);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -184,17 +184,17 @@ void func_80A5063C(EnDnb* this, GlobalContext* globalCtx) {
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++) {
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y, this->particles[i].unk_0C.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->particles[i].unk_18.y, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
Matrix_Translate(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y, this->particles[i].unk_0C.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_RotateXS(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->particles[i].unk_18.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gfx[i]);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -275,16 +275,16 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 0);
|
||||
isGfxSetup = true;
|
||||
}
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
|
||||
if (1) {};
|
||||
arg0->unk_24 = (arg0->unk_01 / (f32)arg0->unk_02) * 255.0f;
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)arg0->unk_24);
|
||||
|
||||
Matrix_InsertTranslation(arg0->unk_0C.x, arg0->unk_0C.y, arg0->unk_0C.z, MTXMODE_NEW);
|
||||
Matrix_Translate(arg0->unk_0C.x, arg0->unk_0C.y, arg0->unk_0C.z, MTXMODE_NEW);
|
||||
Matrix_Scale(arg0->unk_04, arg0->unk_04, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -292,7 +292,7 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80A50CBC[idx]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000020);
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
sp5C += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,10 +285,10 @@ void func_80A51AA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
Vec3s sp3C;
|
||||
|
||||
if (limbIndex == 2) {
|
||||
Matrix_MultiplyVector3fByState(&sp50, &sp44);
|
||||
Matrix_CopyCurrentState(&sp5C);
|
||||
func_8018219C(&sp5C, &sp3C, 0);
|
||||
Matrix_InsertTranslation(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&sp50, &sp44);
|
||||
Matrix_Get(&sp5C);
|
||||
Matrix_MtxFToYXZRot(&sp5C, &sp3C, false);
|
||||
Matrix_Translate(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
if (this->unk_28C & 0x10) {
|
||||
if (this->unk_28C & 0x20) {
|
||||
@@ -311,9 +311,9 @@ void func_80A51AA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
this->unk_294 = sp3C.z;
|
||||
}
|
||||
|
||||
Matrix_RotateY(this->unk_292, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_290, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_294, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->unk_292, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_290, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_294, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -361,10 +361,10 @@ void func_80A51DA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
Vec3s sp3C;
|
||||
|
||||
if (limbIndex == 2) {
|
||||
Matrix_MultiplyVector3fByState(&sp50, &sp44);
|
||||
Matrix_CopyCurrentState(&sp5C);
|
||||
func_8018219C(&sp5C, &sp3C, 0);
|
||||
Matrix_InsertTranslation(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&sp50, &sp44);
|
||||
Matrix_Get(&sp5C);
|
||||
Matrix_MtxFToYXZRot(&sp5C, &sp3C, false);
|
||||
Matrix_Translate(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
if (this->unk_28C & 0x10) {
|
||||
@@ -388,9 +388,9 @@ void func_80A51DA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
this->unk_294 = sp3C.z;
|
||||
}
|
||||
|
||||
Matrix_RotateY(this->unk_292, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_290, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_294, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->unk_292, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_290, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_294, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -152,8 +152,8 @@ void func_80A715DC(EnDno* this, GlobalContext* globalCtx) {
|
||||
if (SubS_LineSegVsPlane(&crace->actor.home.pos, &crace->actor.home.rot, &D_80A73B2C,
|
||||
&this->actor.prevPos, &this->actor.world.pos, &sp88)) {
|
||||
Math_Vec3f_Diff(&this->actor.world.pos, &crace->actor.home.pos, &sp7C);
|
||||
Matrix_RotateY(-crace->actor.home.rot.y, MTXMODE_NEW);
|
||||
Matrix_MultiplyVector3fByState(&sp7C, &sp70);
|
||||
Matrix_RotateYS(-crace->actor.home.rot.y, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&sp7C, &sp70);
|
||||
if ((fabsf(sp70.x) < 100.0f) && (sp70.y >= -10.0f) && (sp70.y <= 180.0f) && (sp70.z < 0.0f)) {
|
||||
crace->unk_170 |= 1;
|
||||
}
|
||||
@@ -970,7 +970,7 @@ void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
if (limbIndex == 13) {
|
||||
Matrix_Scale(this->unk_454, this->unk_454, this->unk_454, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_45C, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_45C, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
gfxOpa = POLY_OPA_DISP;
|
||||
@@ -986,13 +986,13 @@ void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
Matrix_Push();
|
||||
frames = globalCtx->gameplayFrames;
|
||||
Matrix_MultiplyVector3fByState(&D_80A73B40, &sp84);
|
||||
Matrix_MultVec3f(&D_80A73B40, &sp84);
|
||||
func_80A711D0(this, globalCtx, &sp84);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(0.15f, 0.15f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -3200.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, -3200.0f, 0.0f, MTXMODE_APPLY);
|
||||
gfxXlu = func_8012C2B4(POLY_XLU_DISP);
|
||||
|
||||
gSPMatrix(gfxXlu, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -1004,7 +1004,7 @@ void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
|
||||
POLY_XLU_DISP = gfxXlu + 5;
|
||||
|
||||
Matrix_StatePop();
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -425,9 +425,9 @@ s32 func_80B3D974(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 ar
|
||||
Vec3s sp6C;
|
||||
MtxF sp2C;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&gZeroVec3f, &sp74);
|
||||
Matrix_CopyCurrentState(&sp2C);
|
||||
func_8018219C(&sp2C, &sp6C, 0);
|
||||
Matrix_MultVec3f(&gZeroVec3f, &sp74);
|
||||
Matrix_Get(&sp2C);
|
||||
Matrix_MtxFToYXZRot(&sp2C, &sp6C, false);
|
||||
*arg2 = sp74;
|
||||
if (arg4 == 0) {
|
||||
if (arg5 != 0) {
|
||||
@@ -468,13 +468,13 @@ void EnDnp_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thi
|
||||
if (limbIndex == 12) {
|
||||
func_80B3D974(this->unk_330 + 0x4000, this->unk_332 + this->actor.shape.rot.y + 0x4000, &this->unk_1D8,
|
||||
&this->unk_1E4, phi_v1, phi_v0);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_1D8.x, this->unk_1D8.y, this->unk_1D8.z, MTXMODE_NEW);
|
||||
Matrix_Pop();
|
||||
Matrix_Translate(this->unk_1D8.x, this->unk_1D8.y, this->unk_1D8.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_1E4.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_1E4.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_1E4.z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateYS(this->unk_1E4.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1E4.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1E4.z, MTXMODE_APPLY);
|
||||
Matrix_Push();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -380,8 +380,8 @@ void func_8092D108(EnDns* this, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
Matrix_SetTranslateRotateYXZ(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -566,9 +566,9 @@ s32 func_8092D954(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 ar
|
||||
Vec3s sp6C;
|
||||
MtxF sp2C;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&gZeroVec3f, &sp74);
|
||||
Matrix_CopyCurrentState(&sp2C);
|
||||
func_8018219C(&sp2C, &sp6C, 0);
|
||||
Matrix_MultVec3f(&gZeroVec3f, &sp74);
|
||||
Matrix_Get(&sp2C);
|
||||
Matrix_MtxFToYXZRot(&sp2C, &sp6C, false);
|
||||
*arg2 = sp74;
|
||||
|
||||
if (arg4 == 0) {
|
||||
@@ -617,11 +617,11 @@ void EnDns_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
if (limbIndex == KINGS_CHAMBER_DEKU_GUARD_LIMB_HEAD) {
|
||||
func_8092D954(this->unk_2CC, this->unk_2CE + this->actor.shape.rot.y, &this->unk_218, &this->unk_224, phi_v1,
|
||||
phi_v0);
|
||||
Matrix_InsertTranslation(this->unk_218.x, this->unk_218.y, this->unk_218.z, MTXMODE_NEW);
|
||||
Matrix_Translate(this->unk_218.x, this->unk_218.y, this->unk_218.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_224.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_224.z, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_224.x, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(this->unk_224.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_224.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_224.x, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -1081,16 +1081,16 @@ void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
|
||||
Collider_UpdateSpheres(limbIndex, &this->collider1);
|
||||
Collider_UpdateSpheres(limbIndex, &this->collider2);
|
||||
if (D_80879388[limbIndex] != -1) {
|
||||
Matrix_GetStateTranslation(&this->limbPos[D_80879388[limbIndex]]);
|
||||
Matrix_MultZero(&this->limbPos[D_80879388[limbIndex]]);
|
||||
}
|
||||
|
||||
if (limbIndex == 7) {
|
||||
Matrix_MultiplyVector3fByState(&D_80879370, &this->unk_308);
|
||||
Matrix_MultiplyVector3fByState(&D_8087937C, &this->limbPos[0]);
|
||||
Matrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
Matrix_GetStateTranslationAndScaledY(-200.0f, &this->limbPos[1]);
|
||||
Matrix_MultVec3f(&D_80879370, &this->unk_308);
|
||||
Matrix_MultVec3f(&D_8087937C, &this->limbPos[0]);
|
||||
Matrix_MultZero(&this->actor.focus.pos);
|
||||
Matrix_MultVecY(-200.0f, &this->limbPos[1]);
|
||||
} else if (limbIndex == 13) {
|
||||
Matrix_GetStateTranslationAndScaledX(1600.0f, &this->unk_320);
|
||||
Matrix_MultVecX(1600.0f, &this->unk_320);
|
||||
}
|
||||
|
||||
if ((limbIndex == 30) && (this->actionFunc == func_80878424) && (this->timer != this->unk_304)) {
|
||||
|
||||
@@ -725,7 +725,7 @@ void EnDragon_UpdateDamage(EnDragon* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
u32 sp30;
|
||||
|
||||
if ((this->action == DEEP_PYTHON_ACTION_EXTEND)) {
|
||||
if (this->action == DEEP_PYTHON_ACTION_EXTEND) {
|
||||
if ((this->collider.elements[2].info.bumperFlags & BUMP_HIT) ||
|
||||
(this->collider.elements[3].info.bumperFlags & BUMP_HIT) ||
|
||||
(this->collider.elements[4].info.bumperFlags & BUMP_HIT) ||
|
||||
@@ -816,15 +816,15 @@ void EnDragon_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
Vec3f playerGrabOffsetFromJawPos = { 350.0f, -120.0f, -60.0f };
|
||||
|
||||
if (limbIndex == DEEP_PYTHON_LIMB_JAW) {
|
||||
Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->jawPos);
|
||||
Matrix_MultVec3f(&gZeroVec3f, &this->jawPos);
|
||||
playerGrabOffsetFromJawPos.x = 350.0f;
|
||||
playerGrabOffsetFromJawPos.y = -120.0f;
|
||||
playerGrabOffsetFromJawPos.z = -60.0f;
|
||||
Matrix_MultiplyVector3fByState(&playerGrabOffsetFromJawPos, &this->playerGrabPosition);
|
||||
Matrix_MultVec3f(&playerGrabOffsetFromJawPos, &this->playerGrabPosition);
|
||||
}
|
||||
|
||||
if (limbIndex == DEEP_PYTHON_LIMB_HEAD_AND_COLLAR_ROOT) {
|
||||
Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->focusPos);
|
||||
Matrix_MultVec3f(&gZeroVec3f, &this->focusPos);
|
||||
}
|
||||
|
||||
Collider_UpdateSpheres(limbIndex, &this->collider);
|
||||
|
||||
@@ -1558,8 +1558,8 @@ s32 EnElf_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
}
|
||||
scale *= this->actor.scale.x * 124.99999f;
|
||||
|
||||
Matrix_MultiplyVector3fByState(&zeroVec, &sp34);
|
||||
Matrix_InsertTranslation(sp34.x, sp34.y, sp34.z, MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&zeroVec, &sp34);
|
||||
Matrix_Translate(sp34.x, sp34.y, sp34.z, MTXMODE_NEW);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
|
||||
@@ -153,12 +153,12 @@ void EnElfbub_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
|
||||
Matrix_Translate(0.0f, 0.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
Matrix_Scale(this->xyScale + 1.0f, this->xyScale + 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->zRot, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->zRot, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->xScale + 1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->zRot * -1, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->zRot * -1, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_bubble_DL_001000);
|
||||
|
||||
@@ -611,7 +611,7 @@ void EnElforg_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gStrayFairyClockTownTexAnim));
|
||||
break;
|
||||
}
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
|
||||
POLY_XLU_DISP =
|
||||
SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
|
||||
@@ -274,7 +274,7 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++, sPtr++) {
|
||||
if (sPtr->enabled) {
|
||||
Matrix_InsertTranslation(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW);
|
||||
Matrix_Translate(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(sPtr->scale, sPtr->scale, sPtr->scale, MTXMODE_APPLY);
|
||||
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 20);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gSun1Tex));
|
||||
@@ -282,8 +282,8 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) {
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha);
|
||||
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(DEGTORAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(DEGTORAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB58);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user