diff options
| author | cadmic <cadmic24@gmail.com> | 2024-12-08 13:52:48 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-08 16:52:48 -0500 |
| commit | 06ceb8e661a17ed1383189148ce97acf2140fa48 (patch) | |
| tree | cc0503a1b08d41eead06d18db9c676321c01e002 /src/code/code_800430A0.c | |
| parent | bda5e94ded7792308a3b48ccfb09ec38779814ef (diff) | |
Use MM names for some unnamed code files (#2312)
Diffstat (limited to 'src/code/code_800430A0.c')
| -rw-r--r-- | src/code/code_800430A0.c | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c deleted file mode 100644 index 2bdfc6bcd..000000000 --- a/src/code/code_800430A0.c +++ /dev/null @@ -1,119 +0,0 @@ -#include "global.h" -#include "terminal.h" - -/** - * Update the `carriedActor`'s position based on the dynapoly actor identified by `bgId`. - */ -void DynaPolyActor_UpdateCarriedActorPos(CollisionContext* colCtx, s32 bgId, Actor* carriedActor) { - MtxF prevTransform; - MtxF prevTransformInv; - MtxF curTransform; - Vec3f pos; - Vec3f tempPos; - - if (DynaPoly_IsBgIdBgActor(bgId)) { - - SkinMatrix_SetTranslateRotateYXZScale( - &prevTransform, colCtx->dyna.bgActors[bgId].prevTransform.scale.x, - colCtx->dyna.bgActors[bgId].prevTransform.scale.y, colCtx->dyna.bgActors[bgId].prevTransform.scale.z, - colCtx->dyna.bgActors[bgId].prevTransform.rot.x, colCtx->dyna.bgActors[bgId].prevTransform.rot.y, - colCtx->dyna.bgActors[bgId].prevTransform.rot.z, colCtx->dyna.bgActors[bgId].prevTransform.pos.x, - colCtx->dyna.bgActors[bgId].prevTransform.pos.y, colCtx->dyna.bgActors[bgId].prevTransform.pos.z); - - if (SkinMatrix_Invert(&prevTransform, &prevTransformInv) != 2) { - - SkinMatrix_SetTranslateRotateYXZScale( - &curTransform, colCtx->dyna.bgActors[bgId].curTransform.scale.x, - colCtx->dyna.bgActors[bgId].curTransform.scale.y, colCtx->dyna.bgActors[bgId].curTransform.scale.z, - colCtx->dyna.bgActors[bgId].curTransform.rot.x, colCtx->dyna.bgActors[bgId].curTransform.rot.y, - colCtx->dyna.bgActors[bgId].curTransform.rot.z, colCtx->dyna.bgActors[bgId].curTransform.pos.x, - colCtx->dyna.bgActors[bgId].curTransform.pos.y, colCtx->dyna.bgActors[bgId].curTransform.pos.z); - - // Apply the movement of the dynapoly actor `bgId` over the last frame to the `carriedActor` position - // pos = curTransform * prevTransformInv * pos - // Note (curTransform * prevTransformInv) represents the transform relative to the previous frame - SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &carriedActor->world.pos, &tempPos); - SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &pos); - carriedActor->world.pos = pos; - -#if DEBUG_FEATURES - if (BGCHECK_XYZ_ABSMAX <= pos.x || pos.x <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.y || - pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) { - - PRINTF(VT_FGCOL(RED)); - //! @bug file and line are not passed to PRINTF - PRINTF(T("BGCheckCollection_typicalActorPos():位置が妥当ではありません。\n" - "pos (%f,%f,%f) file:%s line:%d\n", - "BGCheckCollection_typicalActorPos(): Position is not valid. \n" - "pos (%f,%f,%f) file:%s line:%d\n"), - pos.x, pos.y, pos.z); - PRINTF(VT_RST); - } -#endif - } - } -} - -/** - * Update the `carriedActor`'s Y rotation based on the dynapoly actor identified by `bgId`. - */ -void DynaPolyActor_UpdateCarriedActorRotY(CollisionContext* colCtx, s32 bgId, Actor* carriedActor) { - if (DynaPoly_IsBgIdBgActor(bgId)) { - s16 rotY = colCtx->dyna.bgActors[bgId].curTransform.rot.y - colCtx->dyna.bgActors[bgId].prevTransform.rot.y; - - if (carriedActor->id == ACTOR_PLAYER) { - ((Player*)carriedActor)->yaw += rotY; - } - - carriedActor->shape.rot.y += rotY; - carriedActor->world.rot.y += rotY; - } -} - -void func_80043334(CollisionContext* colCtx, Actor* actor, s32 bgId) { - if (DynaPoly_IsBgIdBgActor(bgId)) { - DynaPolyActor* dynaActor = DynaPoly_GetActor(colCtx, bgId); - if (dynaActor != NULL) { - DynaPolyActor_SetActorOnTop(dynaActor); - - if (CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_CAN_PRESS_SWITCHES)) { - DynaPolyActor_SetSwitchPressed(dynaActor); - } - } - } -} - -/** - * Update the `carriedActor`'s position and Y rotation based on the dynapoly actor identified by `bgId`, according to - * the dynapoly actor's move flags (see `DYNA_TRANSFORM_POS` and `DYNA_TRANSFORM_ROT_Y`). - */ -s32 DynaPolyActor_TransformCarriedActor(CollisionContext* colCtx, s32 bgId, Actor* carriedActor) { - s32 result = false; - DynaPolyActor* dynaActor; - - if (!DynaPoly_IsBgIdBgActor(bgId)) { - return false; - } - - if ((colCtx->dyna.bgActorFlags[bgId] & BGACTOR_1) || !(colCtx->dyna.bgActorFlags[bgId] & BGACTOR_IN_USE)) { - return false; - } - - dynaActor = DynaPoly_GetActor(colCtx, bgId); - - if (dynaActor == NULL) { - return false; - } - - if (dynaActor->transformFlags & DYNA_TRANSFORM_POS) { - DynaPolyActor_UpdateCarriedActorPos(colCtx, bgId, carriedActor); - result = true; - } - - if (dynaActor->transformFlags & DYNA_TRANSFORM_ROT_Y) { - DynaPolyActor_UpdateCarriedActorRotY(colCtx, bgId, carriedActor); - result = true; - } - - return result; -} |
