1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 15:04:31 +00:00

Actor Struct Changes (and a few related things) (#617)

* reformat header

* type -> category

* done for now i think

* some more stuff

* first -> head

* focus

* flag comment

* ground -> floor

* remove asm, name wrapper funcs

* name func, format

* review

* targetPriority, format

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "0305ec2c2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "0305ec2c2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* comment

* review

* feet flags

* horse shadow
This commit is contained in:
fig02 2021-01-18 16:04:04 -05:00 committed by GitHub
parent 20206fba0d
commit 00a5edea71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
697 changed files with 8157 additions and 7942 deletions

View file

@ -22,9 +22,9 @@ void func_800430A0(CollisionContext* colCtx, s32 bgId, Actor* actor) {
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);
SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->posRot.pos, &tempPos);
SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->world.pos, &tempPos);
SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &pos);
actor->posRot.pos = pos;
actor->world.pos = pos;
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) {
@ -52,7 +52,7 @@ void func_800432A0(CollisionContext* colCtx, s32 bgId, Actor* actor) {
}
actor->shape.rot.y += rot;
actor->posRot.rot.y += rot;
actor->world.rot.y += rot;
}
}

View file

@ -20,8 +20,8 @@ void func_800434B8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 2;
}
void func_800434C8(CollisionContext* colCtx, s32 floorPolySource) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource);
void func_800434C8(CollisionContext* colCtx, s32 floorBgId) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId);
if (dynaActor != NULL) {
func_800434B8(dynaActor);
@ -32,8 +32,8 @@ void func_800434F8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 4;
}
void func_80043508(CollisionContext* colCtx, s32 floorPolySource) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource);
void func_80043508(CollisionContext* colCtx, s32 floorBgId) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId);
if (dynaActor != NULL) {
func_800434F8(dynaActor);
@ -93,9 +93,9 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16
sign = (0.0f <= actor->unk_150) ? 1.0f : -1.0f;
a2 = (f32)arg2 - 0.1f;
posA.x = actor->actor.posRot.pos.x + (a2 * cos);
posA.y = actor->actor.posRot.pos.y + arg4;
posA.z = actor->actor.posRot.pos.z - (a2 * sin);
posA.x = actor->actor.world.pos.x + (a2 * cos);
posA.y = actor->actor.world.pos.y + arg4;
posA.z = actor->actor.world.pos.z - (a2 * sin);
a3 = (f32)arg3 - 0.1f;
posB.x = sign * a3 * sin + posA.x;
@ -105,8 +105,8 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16
actor, 0.0f)) {
return false;
}
posA.x = (actor->actor.posRot.pos.x * 2) - posA.x;
posA.z = (actor->actor.posRot.pos.z * 2) - posA.z;
posA.x = (actor->actor.world.pos.x * 2) - posA.x;
posA.z = (actor->actor.world.pos.z * 2) - posA.z;
posB.x = sign * a3 * sin + posA.x;
posB.z = sign * a3 * cos + posA.z;
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId,

File diff suppressed because it is too large Load diff

View file

@ -2507,10 +2507,10 @@ void BgActor_SetActor(BgActor* bgActor, Actor* actor, CollisionHeader* colHeader
bgActor->prevTransform.scale = actor->scale;
bgActor->prevTransform.rot = actor->shape.rot;
bgActor->prevTransform.rot.x--;
bgActor->prevTransform.pos = actor->posRot.pos;
bgActor->prevTransform.pos = actor->world.pos;
bgActor->curTransform.scale = actor->scale;
bgActor->curTransform.rot = actor->shape.rot;
bgActor->curTransform.pos = actor->posRot.pos;
bgActor->curTransform.pos = actor->world.pos;
}
/**
@ -2742,8 +2742,8 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3
actor = dyna->bgActors[bgId].actor;
dyna->bgActors[bgId].dynaLookup.polyStartIndex = *polyStartIndex;
dyna->bgActors[bgId].vtxStartIndex = *vtxStartIndex;
pos = actor->posRot.pos;
pos.y += actor->shape.unk_08 * actor->scale.y;
pos = actor->world.pos;
pos.y += actor->shape.yOffset * actor->scale.y;
ScaleRotPos_SetValue(&dyna->bgActors[bgId].curTransform, &actor->scale, &actor->shape.rot, &pos);
@ -4494,7 +4494,7 @@ void BgCheck_DrawStaticCollision(GlobalContext* globalCtx, CollisionContext* col
StaticLookup* lookup;
player = PLAYER;
lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.posRot.pos);
lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.world.pos);
if (AREG(23) != 0) {
BgCheck_DrawStaticPolyList(globalCtx, colCtx, &lookup->floor, 0, 0, 255);
}

View file

@ -459,7 +459,7 @@ s32 Camera_GetDataIdxForPoly(Camera* camera, u32* bgId, CollisionPoly* poly) {
PosRot playerPosRot;
s32 ret;
func_8002EF44(&playerPosRot, &camera->player->actor); // unused.
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); // unused.
camDataIdx = SurfaceType_GetCamDataIndex(&camera->globalCtx->colCtx, poly, *bgId);
if (func_80041A4C(&camera->globalCtx->colCtx, camDataIdx, *bgId) == CAM_SET_NONE) {
@ -481,7 +481,7 @@ Vec3s* Camera_GetCamBgDataUnderPlayer(Camera* camera, u16* dataCnt) {
s32 bgId;
PosRot playerPosShape;
func_8002EF44(&playerPosShape, &camera->player->actor);
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
playerPosShape.pos.y += Player_GetHeight(camera->player);
if (BgCheck_EntityRaycastFloor3(&camera->globalCtx->colCtx, &floorPoly, &bgId, &playerPosShape.pos) ==
BGCHECK_Y_MIN) {
@ -503,7 +503,7 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) {
WaterBox* waterBox;
s32 ret;
func_8002EF44(&playerPosShape, &camera->player->actor);
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
*waterY = playerPosShape.pos.y;
if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, playerPosShape.pos.x, playerPosShape.pos.z,
@ -538,7 +538,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
f32 waterY;
WaterBox* waterBox;
func_8002EF44(&playerPosRot, &camera->player->actor);
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
waterY = playerPosRot.pos.y;
if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, chkPos->x, chkPos->z, &waterY,
@ -1184,7 +1184,7 @@ s32 Camera_CalcAtForHorse(Camera* camera, VecSph* eyeAtDir, f32 yOffset, f32* yP
playerHeight = Player_GetHeight(camera->player);
player = camera->player;
func_8002EF44(&horsePosRot, player->rideActor);
Actor_GetWorldPosShapeRot(&horsePosRot, player->rideActor);
if (EN_HORSE_CHECK_5((EnHorse*)player->rideActor)) {
horsePosRot.pos.y -= 49.f;
@ -2171,7 +2171,7 @@ s32 Camera_Jump1(Camera* camera) {
VecSph eyeDiffSph;
VecSph eyeDiffTarget;
PosRot* playerPosRot = &camera->playerPosRot;
PosRot playerPosRot2;
PosRot playerhead;
s16 tangle;
Jump1* jump1 = (Jump1*)camera->paramData;
Jump1Anim* anim = &jump1->anim;
@ -2196,8 +2196,8 @@ s32 Camera_Jump1(Camera* camera) {
Camera_CopyPREGToModeValues(camera);
}
// playerPosRot2 never gets used.
func_8002EEE4(&playerPosRot2, &camera->player->actor);
// playerhead never gets used.
Actor_GetFocus(&playerhead, &camera->player->actor);
OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, at, eye);
OLib_Vec3fDiffToVecSphGeo(&eyeNextAtOffset, at, eyeNext);
@ -2506,7 +2506,7 @@ s32 Camera_Jump3(Camera* camera) {
f32 phi_f0;
f32 phi_f2;
f32 playerHeight;
PosRot playerPosRot2;
PosRot playerhead;
f32 yNormal;
f32 temp_f18;
s32 modeSwitch;
@ -2514,7 +2514,7 @@ s32 Camera_Jump3(Camera* camera) {
Jump3Anim* anim = &jump3->anim;
playerHeight = Player_GetHeight(camera->player);
func_8002EEE4(&playerPosRot2, &camera->player->actor);
Actor_GetFocus(&playerhead, &camera->player->actor);
modeSwitch = false;
if (((camera->waterYPos - eye->y) < OREG(44) || (camera->animState == 0))) {
@ -2611,10 +2611,10 @@ s32 Camera_Jump3(Camera* camera) {
}
if (!(phi_f0 < 10.0f)) {
if (camera->waterYPos <= playerPosRot2.pos.y) {
phi_f2 = playerPosRot2.pos.y - camera->waterYPos;
if (camera->waterYPos <= playerhead.pos.y) {
phi_f2 = playerhead.pos.y - camera->waterYPos;
} else {
phi_f2 = -(playerPosRot2.pos.y - camera->waterYPos);
phi_f2 = -(playerhead.pos.y - camera->waterYPos);
}
if (!(phi_f2 < 50.0f)) {
camera->pitchUpdateRateInv = 100.0f;
@ -2829,7 +2829,7 @@ s32 Camera_Battle1(Camera* camera) {
camera->atLERPStepScale =
Camera_ClampLERPScale(camera, isOffGround ? batt1->atLERPScaleOffGround : batt1->atLERPScaleOnGround);
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
if (anim->target != camera->target) {
osSyncPrintf("camera: battle: change target %d -> " VT_FGCOL(BLUE) "%d" VT_RST "\n", anim->target->id,
camera->target->id);
@ -3108,17 +3108,17 @@ s32 Camera_KeepOn1(Camera* camera) {
switch (camera->paramFlags & 0x18) {
case 8:
if ((camera->player->actor.type == 2) && (camera->player->interactRangeActor == camera->target)) {
if ((camera->player->actor.category == 2) && (camera->player->interactRangeActor == camera->target)) {
PosRot sp54;
func_8002EEE4(&sp54, &camera->player->actor);
Actor_GetFocus(&sp54, &camera->player->actor);
spC8.r = 60.0f;
spC8.yaw = camera->playerPosRot.rot.y;
spC8.pitch = 0x2EE0;
Camera_Vec3fVecSphGeoAdd(&camera->targetPosRot.pos, &sp54.pos, &spC8);
} else {
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
if (anim->unk_0C != camera->target) {
anim->unk_0C = camera->target;
camera->atLERPStepScale = 0.0f;
@ -3324,8 +3324,8 @@ s32 Camera_KeepOn3(Camera* camera) {
playerHeight += keep3->yOffset;
OLib_Vec3fDiffToVecSphGeo(&atToEyeDir, at, eye);
OLib_Vec3fDiffToVecSphGeo(&atToEyeNextDir, at, eyeNext);
func_8002EEE4(&camera->targetPosRot, camera->target);
func_8002EEE4(&playerPosRot, &camera->player->actor);
Actor_GetFocus(&camera->targetPosRot, camera->target);
Actor_GetFocus(&playerPosRot, &camera->player->actor);
playerHeadPos = camPlayerPosRot->pos;
playerHeadPos.y += playerHeight;
OLib_Vec3fDiffToVecSphGeo(&targetToPlayerDir, &playerHeadPos, &camera->targetPosRot.pos);
@ -3470,7 +3470,7 @@ s32 Camera_KeepOn4(Camera* camera) {
s16 angleCnt;
s32 i;
player = (Player*)camera->globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first;
player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head;
if (camera->animState == 0 || camera->animState == 0xA || camera->animState == 0x14) {
if (camera->globalCtx->view.unk_124 == 0) {
@ -3634,7 +3634,7 @@ s32 Camera_KeepOn4(Camera* camera) {
} else if ((keep4->unk_1C & 8) && camera->target != NULL) {
PosRot sp60;
func_8002EF44(&sp60, camera->target);
Actor_GetWorldPosShapeRot(&sp60, camera->target);
spA2 = DEGF_TO_BINANG(keep4->unk_08) - sp60.rot.x;
spA0 = BINANG_SUB(BINANG_ROT180(sp60.rot.y), spA8.yaw) > 0
? BINANG_ROT180(sp60.rot.y) + DEGF_TO_BINANG(keep4->unk_0C)
@ -3644,7 +3644,7 @@ s32 Camera_KeepOn4(Camera* camera) {
} else if ((keep4->unk_1C & 0x80) && camera->target != NULL) {
PosRot sp4C;
func_8002EF14(&sp4C, camera->target);
Actor_GetWorld(&sp4C, camera->target);
spA2 = DEGF_TO_BINANG(keep4->unk_08);
sp9E = Camera_XZAngle(&sp4C.pos, &playerPosRot->pos);
spA0 = (BINANG_SUB(sp9E, spA8.yaw) > 0) ? sp9E + DEGF_TO_BINANG(keep4->unk_0C)
@ -3786,7 +3786,7 @@ s32 Camera_KeepOn0(Camera* camera) {
return true;
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, eye, at);
OLib_Vec3fDiffToVecSphGeo(&eyeTargetPosOffset, eye, &camera->targetPosRot.pos);
@ -4144,7 +4144,7 @@ s32 Camera_Subj3(Camera* camera) {
Vec3f* pad2;
f32 playerHeight;
func_8002EEE4(&sp60, &camera->player->actor);
Actor_GetFocus(&sp60, &camera->player->actor);
playerHeight = Player_GetHeight(camera->player);
if (camera->globalCtx->view.unk_124 == 0) {
@ -4280,7 +4280,7 @@ s32 Camera_Subj4(Camera* camera) {
return true;
}
func_8002EF44(&sp6C, &camera->player->actor);
Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor);
OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eye);
sCameraInterfaceFlags = subj4->interfaceFlags;
@ -4333,7 +4333,7 @@ s32 Camera_Subj4(Camera* camera) {
return false;
}
func_8002EF44(&sp6C, &camera->player->actor);
Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor);
Math3D_LineClosestToPoint(&anim->unk_00, &sp6C.pos, eyeNext);
at->x = eyeNext->x + anim->unk_00.b.x;
at->y = eyeNext->y + anim->unk_00.b.y;
@ -4358,8 +4358,8 @@ s32 Camera_Subj4(Camera* camera) {
}
anim->unk_28 = temp_f16;
camera->player->actor.posRot.pos = *eyeNext;
camera->player->actor.posRot.pos.y = camera->playerGroundY;
camera->player->actor.world.pos = *eyeNext;
camera->player->actor.world.pos.y = camera->playerGroundY;
camera->player->actor.shape.rot.y = sp64.yaw;
temp_f16 = ((240.0f * temp_f16) * (anim->unk_24 * 0.416667f));
temp_a0 = temp_f16 + anim->unk_30;
@ -4478,7 +4478,7 @@ s32 Camera_Unique1(Camera* camera) {
VecSph eyeAtOffset;
VecSph eyeNextAtOffset;
PosRot* playerPosRot = &camera->playerPosRot;
PosRot playerPosRot2;
PosRot playerhead;
Unique1* uniq1 = (Unique1*)camera->paramData;
Unique1Anim* anim = &uniq1->anim;
s32 pad;
@ -4522,7 +4522,7 @@ s32 Camera_Unique1(Camera* camera) {
camera->animState++;
}
func_8002EEE4(&playerPosRot2, &camera->player->actor); // unused
Actor_GetFocus(&playerhead, &camera->player->actor); // unused
camera->yawUpdateRateInv = Camera_LERPCeilF(100.0f, camera->yawUpdateRateInv, OREG(25) * 0.01f, 0.1f);
camera->pitchUpdateRateInv = Camera_LERPCeilF(100.0f, camera->pitchUpdateRateInv, OREG(25) * 0.01f, 0.1f);
@ -5001,8 +5001,8 @@ s32 Camera_Unique9(Camera* camera) {
s16 atInitFlags;
s16 eyeInitFlags;
s16 pad2;
PosRot targetPosRot2;
PosRot playerPosRot2;
PosRot targethead;
PosRot playerhead;
PosRot playerPosRot;
Vec3f* eyeNext = &camera->eyeNext;
Vec3f* at = &camera->at;
@ -5028,7 +5028,7 @@ s32 Camera_Unique9(Camera* camera) {
sCameraInterfaceFlags = uniq9->interfaceFlags;
func_8002EF14(&playerPosRot, &camera->player->actor);
Actor_GetWorld(&playerPosRot, &camera->player->actor);
if (camera->animState == 0) {
camera->animState++;
@ -5094,11 +5094,11 @@ s32 Camera_Unique9(Camera* camera) {
}
} else if (atInitFlags == 4 || atInitFlags == 0x84) {
if (camera->target != NULL && camera->target->update != NULL) {
func_8002EEE4(&targetPosRot2, camera->target);
func_8002EEE4(&playerPosRot2, &camera->player->actor);
playerPosRot2.pos.x = playerPosRot.pos.x;
playerPosRot2.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos);
Actor_GetFocus(&targethead, camera->target);
Actor_GetFocus(&playerhead, &camera->player->actor);
playerhead.pos.x = playerPosRot.pos.x;
playerhead.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos);
if (atInitFlags & (s16)0x8080) {
scratchSph.pitch = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.x);
scratchSph.yaw = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.y);
@ -5108,7 +5108,7 @@ s32 Camera_Unique9(Camera* camera) {
}
scratchSph.yaw += playerTargetOffset.yaw;
scratchSph.pitch += playerTargetOffset.pitch;
Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targetPosRot2.pos, &scratchSph);
Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targethead.pos, &scratchSph);
} else {
if (camera->target == NULL) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: warning: demo C: actor is not valid\n" VT_RST);
@ -5130,14 +5130,14 @@ s32 Camera_Unique9(Camera* camera) {
if (focusActor != NULL) {
if ((atInitFlags & 0xF) == 1) {
// posRot2
func_8002EEE4(&atFocusPosRot, focusActor);
// head
Actor_GetFocus(&atFocusPosRot, focusActor);
} else if ((atInitFlags & 0xF) == 2) {
// posRot
func_8002EF14(&atFocusPosRot, focusActor);
// world
Actor_GetWorld(&atFocusPosRot, focusActor);
} else {
// posRot, shape rot
func_8002EF44(&atFocusPosRot, focusActor);
// world, shape rot
Actor_GetWorldPosShapeRot(&atFocusPosRot, focusActor);
}
if (atInitFlags & (s16)0x8080) {
@ -5181,13 +5181,13 @@ s32 Camera_Unique9(Camera* camera) {
if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400 || eyeInitFlags == 0x500 ||
eyeInitFlags == (s16)0x8500) {
if (camera->target != NULL && camera->target->update != NULL) {
func_8002EEE4(&targetPosRot2, camera->target);
func_8002EEE4(&playerPosRot2, &camera->player->actor);
playerPosRot2.pos.x = playerPosRot.pos.x;
playerPosRot2.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos);
Actor_GetFocus(&targethead, camera->target);
Actor_GetFocus(&playerhead, &camera->player->actor);
playerhead.pos.x = playerPosRot.pos.x;
playerhead.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos);
if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400) {
eyeLookAtPos = targetPosRot2.pos;
eyeLookAtPos = targethead.pos;
} else {
eyeLookAtPos = anim->atTarget;
}
@ -5224,14 +5224,14 @@ s32 Camera_Unique9(Camera* camera) {
if (focusActor != NULL) {
if ((eyeInitFlags & 0xF00) == 0x100) {
// posRot2
func_8002EEE4(&eyeFocusPosRot, focusActor);
// head
Actor_GetFocus(&eyeFocusPosRot, focusActor);
} else if ((eyeInitFlags & 0xF00) == 0x200) {
// posRot
func_8002EF14(&eyeFocusPosRot, focusActor);
// world
Actor_GetWorld(&eyeFocusPosRot, focusActor);
} else {
// posRot, shapeRot
func_8002EF44(&eyeFocusPosRot, focusActor);
// world, shapeRot
Actor_GetWorldPosShapeRot(&eyeFocusPosRot, focusActor);
}
if (eyeInitFlags & (s16)0x8080) {
@ -5436,10 +5436,10 @@ s32 Camera_Unique9(Camera* camera) {
if (anim->curKeyFrame->actionFlags & 0x40) {
// Set the player's position
camera->player->actor.posRot.pos.x = anim->playerPos.x;
camera->player->actor.posRot.pos.z = anim->playerPos.z;
camera->player->actor.world.pos.x = anim->playerPos.x;
camera->player->actor.world.pos.z = anim->playerPos.z;
if (camera->player->stateFlags1 & 0x8000000 && player->currentBoots != PLAYER_BOOTS_IRON) {
camera->player->actor.posRot.pos.y = anim->playerPos.y;
camera->player->actor.world.pos.y = anim->playerPos.y;
}
} else {
anim->playerPos.x = playerPosRot.pos.x;
@ -5555,7 +5555,7 @@ s32 Camera_Demo1(Camera* camera) {
// if the camera is set to be relative to the player, move the interpolated points
// relative to the player's position
if (camera->player != NULL && camera->player->actor.update != NULL) {
func_8002EF14(&curPlayerPosRot, &camera->player->actor);
Actor_GetWorld(&curPlayerPosRot, &camera->player->actor);
Camera_RotateAroundPoint(&curPlayerPosRot, &csEyeUpdate, eyeNext);
Camera_RotateAroundPoint(&curPlayerPosRot, &csAtUpdate, at);
} else {
@ -5811,8 +5811,8 @@ s32 Camera_Demo5(Camera* camera) {
VecSph playerTargetGeo;
VecSph eyePlayerGeo;
VecSph sp78;
PosRot playerPosRot2;
PosRot targetPosRot2;
PosRot playerhead;
PosRot targethead;
Player* player;
s16 sp4A;
s32 pad;
@ -5820,7 +5820,7 @@ s32 Camera_Demo5(Camera* camera) {
s16 t;
s32 pad2;
func_8002EEE4(&playerPosRot2, &camera->player->actor);
Actor_GetFocus(&playerhead, &camera->player->actor);
player = camera->player;
sCameraInterfaceFlags = 0x3200;
if ((camera->target == NULL) || (camera->target->update == NULL)) {
@ -5830,14 +5830,14 @@ s32 Camera_Demo5(Camera* camera) {
camera->target = NULL;
return true;
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
OLib_Vec3fDiffToVecSphGeo(&playerTargetGeo, &camera->targetPosRot.pos, &camera->playerPosRot.pos);
D_8011D3AC = camera->target->type;
D_8011D3AC = camera->target->category;
func_8002F374(camera->globalCtx, camera->target, &sp78.yaw, &sp78.pitch);
eyeTargetDist = OLib_Vec3fDist(&camera->targetPosRot.pos, &camera->eye);
OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerPosRot2.pos, &camera->eyeNext);
OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerhead.pos, &camera->eyeNext);
sp4A = eyePlayerGeo.yaw - playerTargetGeo.yaw;
if (camera->target->type == ACTORTYPE_PLAYER) {
if (camera->target->category == ACTORCAT_PLAYER) {
// camera is targeting a(the) player actor
if (eyePlayerGeo.r > 30.0f) {
D_8011D6AC[1].timerInit = camera->timer - 1;
@ -5925,7 +5925,7 @@ s32 Camera_Demo5(Camera* camera) {
camera->timer += D_8011D8DC[1].timerInit + D_8011D8DC[2].timerInit;
}
}
} else if (camera->target->type == ACTORTYPE_DOOR) {
} else if (camera->target->category == ACTORCAT_DOOR) {
// the target is a door.
D_8011D954[0].timerInit = camera->timer - 5;
sp4A = 0;
@ -5945,10 +5945,10 @@ s32 Camera_Demo5(Camera* camera) {
temp_v0 = Rand_ZeroOne() * (sp90 * -0.2f);
D_8011D954[1].rollTargetInit = temp_v0;
D_8011D954[0].rollTargetInit = temp_v0;
func_8002EEE4(&targetPosRot2, camera->target);
targetPosRot2.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A));
targetPosRot2.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A));
if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) {
Actor_GetFocus(&targethead, camera->target);
targethead.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A));
targethead.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A));
if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) {
D_8011D954[1].actionFlags = 0xC1;
D_8011D954[2].actionFlags = 0x8F;
} else {
@ -5971,8 +5971,8 @@ s32 Camera_Demo5(Camera* camera) {
}
Player_GetHeight(camera->player);
D_8011D9F4[0].timerInit = camera->timer;
func_8002EEE4(&targetPosRot2, camera->target);
if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) {
Actor_GetFocus(&targethead, camera->target);
if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) {
D_8011D9F4[1].timerInit = 4;
D_8011D9F4[1].actionFlags = 0x8F;
} else {
@ -6006,8 +6006,8 @@ s32 Camera_Demo5(Camera* camera) {
// env frozen
player->actor.freezeTimer = camera->timer;
} else {
sp4A = playerPosRot2.rot.y - playerTargetGeo.yaw;
if (camera->target->type == ACTORTYPE_PLAYER) {
sp4A = playerhead.rot.y - playerTargetGeo.yaw;
if (camera->target->category == ACTORCAT_PLAYER) {
pad = camera->globalCtx->state.frames - sDemo5PrevAction12Frame;
if (player->stateFlags1 & 0x800) {
// holding object over head.
@ -6063,7 +6063,7 @@ s32 Camera_Demo6(Camera* camera) {
// initalizes the camera state.
anim->animTimer = 0;
camera->fov = 60.0f;
func_8002EF14(&focusPosRot, camFocus);
Actor_GetWorld(&focusPosRot, camFocus);
camera->at.x = focusPosRot.pos.x;
camera->at.y = focusPosRot.pos.y + 20.0f;
camera->at.z = focusPosRot.pos.z;
@ -6078,7 +6078,7 @@ s32 Camera_Demo6(Camera* camera) {
case 1:
if (stateTimers[camera->animState] < anim->animTimer) {
func_8002DF54(camera->globalCtx, &camera->player->actor, 8);
func_8002EF14(&focusPosRot, camFocus);
Actor_GetWorld(&focusPosRot, camFocus);
anim->atTarget.x = focusPosRot.pos.x;
anim->atTarget.y = focusPosRot.pos.y - 20.0f;
anim->atTarget.z = focusPosRot.pos.z;
@ -6103,7 +6103,7 @@ s32 Camera_Demo6(Camera* camera) {
}
anim->animTimer++;
func_8002EF14(&focusPosRot, camFocus);
Actor_GetWorld(&focusPosRot, camFocus);
return true;
}
@ -6198,13 +6198,13 @@ s32 Camera_Demo9(Camera* camera) {
Camera_RotateAroundPoint(cam0PlayerPosRot, &csAtUpdate, &newAt);
} else if (demo9OnePoint->onePointDemo.actionParameters == 4) {
// rotate around the current camera's player
func_8002EF14(&focusPosRot, &camera->player->actor);
Actor_GetWorld(&focusPosRot, &camera->player->actor);
Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye);
Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt);
} else if (demo9OnePoint->onePointDemo.actionParameters == 8) {
// rotate around the current camera's target
if (camera->target != NULL && camera->target->update != NULL) {
func_8002EF14(&focusPosRot, camera->target);
Actor_GetWorld(&focusPosRot, camera->target);
Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye);
Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt);
} else {
@ -6297,7 +6297,7 @@ s32 Camera_Special0(Camera* camera) {
return true;
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
Camera_LERPCeilVec3f(&camera->targetPosRot.pos, &camera->at, spec0->lerpAtScale, spec0->lerpAtScale, 0.1f);
camera->posOffset.x = camera->at.x - playerPosRot->pos.x;
@ -6343,7 +6343,7 @@ s32 Camera_Special4(Camera* camera) {
return false;
} else {
camera->roll = -0x1F4;
func_8002EF14(&curTargetPosRot, camera->target);
Actor_GetWorld(&curTargetPosRot, camera->target);
camera->at = curTargetPosRot.pos;
camera->at.y -= 150.0f;
@ -6401,7 +6401,7 @@ s32 Camera_Special5(Camera* camera) {
OLib_Vec3fDiffToVecSphGeo(&sp64, at, eye);
OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eyeNext);
func_8002EF14(&spA8, camera->target);
Actor_GetWorld(&spA8, camera->target);
sCameraInterfaceFlags = spec5->interfaceFlags;
@ -6647,7 +6647,7 @@ s32 Camera_Special9(Camera* camera) {
}
if (spec9->doorParams.doorActor != NULL) {
func_8002EF44(&adjustedPlayerPosRot, spec9->doorParams.doorActor);
Actor_GetWorldPosShapeRot(&adjustedPlayerPosRot, spec9->doorParams.doorActor);
} else {
adjustedPlayerPosRot = *playerPosRot;
adjustedPlayerPosRot.pos.y += playerYOffset + params->yOffset;
@ -6894,7 +6894,7 @@ void Camera_InitPlayerSettings(Camera* camera, Player* player) {
Vec3f* at = &camera->at;
Vec3f* eyeNext = &camera->eyeNext;
func_8002EF44(&playerPosShape, &player->actor);
Actor_GetWorldPosShapeRot(&playerPosShape, &player->actor);
playerYOffset = Player_GetHeight(player);
camera->player = player;
camera->playerPosRot = playerPosShape;
@ -7333,7 +7333,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) {
sUpdateCameraDirection = false;
if (camera->player != NULL) {
func_8002EF44(&curPlayerPosRot, &camera->player->actor);
Actor_GetWorldPosShapeRot(&curPlayerPosRot, &camera->player->actor);
camera->xzSpeed = playerXZSpeed = OLib_Vec3fDistXZ(&curPlayerPosRot.pos, &camera->playerPosRot.pos);
camera->speedRatio = OLib_ClampMaxDist(playerXZSpeed / (func_8002DCE4(camera->player) * PCT(OREG(8))), 1.0f);
@ -7558,7 +7558,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) {
*/
void Camera_Finish(Camera* camera) {
Camera* defaultCam = camera->globalCtx->cameraPtrs[0];
Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first;
Player* player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head;
if (camera->timer == 0) {
Gameplay_ChangeCameraStatus(camera->globalCtx, camera->parentCamIdx, 7);
@ -7966,7 +7966,7 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa
if (camera->data2 != 0) {
camera->player = player;
func_8002EF44(&playerPosRot, &player->actor);
Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
camera->playerPosRot = playerPosRot;
camera->nextCamDataIdx = -1;
@ -8042,7 +8042,7 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) {
func_80043B60(dstCamera);
if (dstCamera->player != NULL) {
func_8002EF14(&dstCamera->playerPosRot, &dstCamera->player->actor);
Actor_GetWorld(&dstCamera->playerPosRot, &dstCamera->player->actor);
dstCamera->posOffset.x = dstCamera->at.x - dstCamera->playerPosRot.pos.x;
dstCamera->posOffset.y = dstCamera->at.y - dstCamera->playerPosRot.pos.y;
dstCamera->posOffset.z = dstCamera->at.z - dstCamera->playerPosRot.pos.z;

View file

@ -1632,7 +1632,7 @@ void CollisionCheck_HitSolid(GlobalContext* globalCtx, ColliderInfo* info, Colli
* Plays a hit sound effect for AT colliders attached to Player based on the AC element's elemType.
*/
s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) {
if (at->actor != NULL && at->actor->type == ACTORTYPE_PLAYER) {
if (at->actor != NULL && at->actor->category == ACTORCAT_PLAYER) {
if (acInfo->elemType == ELEMTYPE_UNK0) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
@ -2962,8 +2962,8 @@ void CollisionCheck_ResetDamage(CollisionCheckInfo* info) {
*/
void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init) {
info->health = init->health;
info->unk_10 = init->unk_02;
info->unk_12 = init->unk_04;
info->cylRadius = init->cylRadius;
info->cylHeight = init->cylHeight;
info->mass = init->mass;
}
@ -2973,8 +2973,8 @@ void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionChec
void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init) {
info->health = init->health;
info->damageTable = damageTable;
info->unk_10 = init->unk_02;
info->unk_12 = init->unk_04;
info->cylRadius = init->cylRadius;
info->cylHeight = init->cylHeight;
info->mass = init->mass;
}
@ -2984,9 +2984,9 @@ void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable,
void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init) {
info->health = init->health;
info->damageTable = damageTable;
info->unk_10 = init->unk_02;
info->unk_12 = init->unk_04;
info->unk_14 = init->unk_06;
info->cylRadius = init->cylRadius;
info->cylHeight = init->cylHeight;
info->cylYShift = init->cylYShift;
info->mass = init->mass;
}
@ -3218,9 +3218,9 @@ s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext*
* Moves the ColliderCylinder's position to the actor's position
*/
void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider) {
collider->dim.pos.x = actor->posRot.pos.x;
collider->dim.pos.y = actor->posRot.pos.y;
collider->dim.pos.z = actor->posRot.pos.z;
collider->dim.pos.x = actor->world.pos.x;
collider->dim.pos.y = actor->world.pos.y;
collider->dim.pos.z = actor->world.pos.z;
}
/**

View file

@ -23,7 +23,7 @@ void func_8001D5C8(EnAObj* this, s16 params);
const ActorInit En_A_Obj_InitVars = {
ACTOR_EN_A_OBJ,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(EnAObj),
@ -108,9 +108,9 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
sp28 = 12.0f;
}
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28);
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, sp28);
thisx->posRot2.pos = thisx->posRot.pos;
thisx->focus.pos = thisx->world.pos;
this->dyna.bgId = BGACTOR_NEG_ONE;
this->dyna.unk_160 = 0;
this->dyna.unk_15C = DPM_UNK;
@ -121,13 +121,13 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
case A_OBJ_BLOCK_LARGE:
case A_OBJ_BLOCK_HUGE:
this->dyna.bgId = 1;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
func_8001D5C8(this, thisx->params);
break;
case A_OBJ_BLOCK_SMALL_ROT:
case A_OBJ_BLOCK_LARGE_ROT:
this->dyna.bgId = 3;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
func_8001D310(this, thisx->params);
break;
case A_OBJ_UNKNOWN_6:
@ -146,14 +146,14 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
case A_OBJ_SIGNPOST_ARROW:
thisx->textId = (this->textId & 0xFF) | 0x300;
// clang-format off
thisx->flags |= 0x1 | 0x8; thisx->unk_4C = 500.0f;
thisx->flags |= 0x1 | 0x8; thisx->targetArrowOffset = 500.0f;
// clang-format on
this->unk_178 = 45.0f;
func_8001D234(this, thisx->params);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
thisx->colChkInfo.mass = MASS_IMMOVABLE;
thisx->unk_1F = 0;
thisx->targetMode = 0;
break;
case A_OBJ_KNOB:
thisx->gravity = -1.5f;
@ -201,7 +201,7 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
s16 var;
if (this->dyna.actor.textId != 0) {
var = this->dyna.actor.yawTowardsLink - this->dyna.actor.shape.rot.y;
var = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
if ((ABS(var) < 0x2800) || ((this->dyna.actor.params == 0xA) && (ABS(var) > 0x5800))) {
if (func_8002F194(&this->dyna.actor, globalCtx)) {
EnAObj_SetupAction(this, func_8001D204);
@ -215,8 +215,8 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
void func_8001D310(EnAObj* this, s16 params) {
this->unk_16E = 0;
this->unk_168 = 10;
this->dyna.actor.posRot.rot.y = 0;
this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot;
this->dyna.actor.world.rot.y = 0;
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
EnAObj_SetupAction(this, func_8001D360);
}
@ -226,13 +226,13 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
this->unk_16E++;
this->unk_170 = 20;
if ((s16)(this->dyna.actor.yawTowardsLink + 0x4000) < 0) {
if ((s16)(this->dyna.actor.yawTowardsPlayer + 0x4000) < 0) {
this->unk_174 = -1000;
} else {
this->unk_174 = 1000;
}
if (this->dyna.actor.yawTowardsLink < 0) {
if (this->dyna.actor.yawTowardsPlayer < 0) {
this->unk_172 = -this->unk_174;
} else {
this->unk_172 = this->unk_174;
@ -248,12 +248,12 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
this->dyna.actor.gravity = -1.0f;
if (this->unk_170 == 0) {
this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos;
this->dyna.actor.world.pos = this->dyna.actor.home.pos;
this->unk_16E = 0;
this->unk_168 = 10;
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.gravity = 0.0f;
this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot;
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
}
}
}
@ -265,14 +265,13 @@ void func_8001D480(EnAObj* this, s16 params) {
void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.posRot.rot.x >> 1);
this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.posRot.rot.z >> 1);
this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.world.rot.x >> 1);
this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.world.rot.z >> 1);
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 0x8)) {
if (1) { // Necessary to match
this->dyna.actor.posRot.rot.y =
((this->dyna.actor.wallPolyRot - this->dyna.actor.posRot.rot.y) + this->dyna.actor.wallPolyRot) -
0x8000;
this->dyna.actor.world.rot.y =
((this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw) - 0x8000;
}
this->dyna.actor.bgCheckFlags &= ~0x8;
}
@ -296,7 +295,7 @@ void func_8001D5C8(EnAObj* this, s16 params) {
void func_8001D608(EnAObj* this, GlobalContext* globalCtx) {
this->dyna.actor.speedXZ += this->dyna.unk_150;
this->dyna.actor.posRot.rot.y = this->dyna.unk_158;
this->dyna.actor.world.rot.y = this->dyna.unk_158;
this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f);
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
@ -317,14 +316,14 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->dyna.actor.gravity != 0.0f) {
if (this->dyna.actor.params != A_OBJ_KNOB) {
func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D);
} else {
func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D);
}
}
this->dyna.actor.posRot2.pos = this->dyna.actor.posRot.pos;
this->dyna.actor.posRot2.pos.y += this->unk_178;
this->dyna.actor.focus.pos = this->dyna.actor.world.pos;
this->dyna.actor.focus.pos.y += this->unk_178;
switch (this->dyna.actor.params) {
case A_OBJ_SIGNPOST_OBLONG:

View file

@ -18,7 +18,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx);
const ActorInit En_Item00_InitVars = {
ACTOR_EN_ITEM00,
ACTORTYPE_MISC,
ACTORCAT_MISC,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(EnItem00),
@ -96,7 +96,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.02f;
break;
case ITEM00_HEART:
this->actor.initPosRot.rot.z = Rand_CenteredFloat(65535.0f);
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
sp34 = 430.0f;
Actor_SetScale(&this->actor, 0.02f);
this->unk_15C = 0.02f;
@ -157,7 +157,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.5f;
sp34 = 0.0f;
sp30 = 0.6f;
this->actor.posRot.rot.x = 0x4000;
this->actor.world.rot.x = 0x4000;
break;
case ITEM00_SHIELD_HYLIAN:
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_2);
@ -166,7 +166,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.5f;
sp34 = 0.0f;
sp30 = 0.6f;
this->actor.posRot.rot.x = 0x4000;
this->actor.world.rot.x = 0x4000;
break;
case ITEM00_TUNIC_ZORA:
case ITEM00_TUNIC_GORON:
@ -176,14 +176,14 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.5f;
sp34 = 0.0f;
sp30 = 0.6f;
this->actor.posRot.rot.x = 0x4000;
this->actor.world.rot.x = 0x4000;
break;
}
this->unk_156 = 0;
ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawFunc_Circle, sp30);
this->actor.shape.unk_14 = 0xB4;
this->actor.posRot2.pos = this->actor.posRot.pos;
ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawCircle, sp30);
this->actor.shape.shadowAlpha = 0xB4;
this->actor.focus.pos = this->actor.world.pos;
this->unk_152 = 0;
if (!spawnParam8000) {
@ -286,20 +286,20 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
} else {
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) {
if (this->unk_15A == -1) {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) {
this->unk_15A = -2;
}
} else {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) {
this->unk_15A = -1;
}
}
Math_SmoothStepToS(&this->actor.posRot.rot.x, 0, 2, 2500, 500);
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500);
}
}
if (this->actor.params == ITEM00_HEART_PIECE) {
this->actor.shape.unk_08 = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
}
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
@ -332,9 +332,9 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) {
}
if (globalCtx->gameplayFrames & 1) {
pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(10.0f);
pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(10.0f);
pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(10.0f);
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(10.0f);
pos.y = this->actor.world.pos.y + Rand_CenteredFloat(10.0f);
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(10.0f);
EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
}
@ -364,20 +364,20 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
if (this->actor.velocity.y < -1.5f) {
this->actor.velocity.y = -1.5f;
}
this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
this->actor.posRot.pos.x +=
Math_CosS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z));
this->actor.posRot.pos.z +=
Math_SinS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z));
this->actor.home.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
this->actor.world.pos.x +=
Math_CosS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z));
this->actor.world.pos.z +=
Math_SinS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z));
}
}
if (this->actor.params <= ITEM00_RUPEE_RED) {
this->actor.shape.rot.y += 960;
} else if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) {
this->actor.posRot.rot.x -= 700;
this->actor.world.rot.x -= 700;
this->actor.shape.rot.y += 400;
this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000;
this->actor.shape.rot.x = this->actor.world.rot.x - 0x4000;
}
if (this->actor.velocity.y <= 2.0f) {
@ -390,9 +390,9 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
}
if (!(globalCtx->gameplayFrames & 1)) {
pos.x = this->actor.posRot.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.z = this->actor.posRot.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.x = this->actor.world.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.y = this->actor.world.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f;
EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
}
@ -421,7 +421,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
return;
}
this->actor.posRot.pos = player->actor.posRot.pos;
this->actor.world.pos = player->actor.world.pos;
if (this->actor.params <= ITEM00_RUPEE_RED) {
this->actor.shape.rot.y += 960;
@ -429,10 +429,10 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y = 0;
}
this->actor.posRot.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
this->actor.world.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
if (LINK_IS_ADULT) {
this->actor.posRot.pos.y += 20.0f;
this->actor.world.pos.y += 20.0f;
}
}
@ -475,9 +475,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
if (globalCtx->colCtx.dyna.bgActorFlags[i] & 1) {
dynaActor = globalCtx->colCtx.dyna.bgActors[i].actor;
if ((dynaActor != NULL) && (dynaActor->update != NULL) &&
((dynaActor->posRot.pos.x != dynaActor->pos4.x) ||
(dynaActor->posRot.pos.y != dynaActor->pos4.y) ||
(dynaActor->posRot.pos.z != dynaActor->pos4.z))) {
((dynaActor->world.pos.x != dynaActor->prevPos.x) ||
(dynaActor->world.pos.y != dynaActor->prevPos.y) ||
(dynaActor->world.pos.z != dynaActor->prevPos.z))) {
D_80157D94++;
break;
}
@ -490,9 +490,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (sp3A || D_80157D94) {
func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D);
if (this->actor.groundY <= -10000.0f) {
if (this->actor.floorHeight <= -10000.0f) {
Actor_Kill(&this->actor);
return;
}
@ -505,11 +505,11 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
if ((this->actor.params == ITEM00_SHIELD_DEKU) || (this->actor.params == ITEM00_SHIELD_HYLIAN) ||
(this->actor.params == ITEM00_TUNIC_ZORA) || (this->actor.params == ITEM00_TUNIC_GORON)) {
f32 newUnkBC = Math_CosS(this->actor.shape.rot.x) * 37.0f;
this->actor.shape.unk_08 = newUnkBC;
this->actor.shape.yOffset = newUnkBC;
if (newUnkBC >= 0.0f) {
this->actor.shape.unk_08 = this->actor.shape.unk_08;
this->actor.shape.yOffset = this->actor.shape.yOffset;
} else {
this->actor.shape.unk_08 = -this->actor.shape.unk_08;
this->actor.shape.yOffset = -this->actor.shape.yOffset;
}
}
@ -517,8 +517,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (!((this->actor.xzDistToLink <= 30.0f) && (this->actor.yDistToLink >= -50.0f) &&
(this->actor.yDistToLink <= 50.0f))) {
if (!((this->actor.xzDistToPlayer <= 30.0f) && (this->actor.yDistToPlayer >= -50.0f) &&
(this->actor.yDistToPlayer <= 50.0f))) {
if (!Actor_HasParent(&this->actor, globalCtx)) {
return;
}
@ -890,7 +890,7 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 pa
spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f;
spawnedActor->actor.speedXZ = 2.0f;
spawnedActor->actor.gravity = -0.9f;
spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
Actor_SetScale(&spawnedActor->actor, 0.0f);
EnItem00_SetupAction(spawnedActor, func_8001E304);
spawnedActor->unk_15A = 220;
@ -931,7 +931,7 @@ EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 p
spawnedActor->actor.velocity.y = 0.0f;
spawnedActor->actor.speedXZ = 0.0f;
spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f;
spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.flags |= 0x0010;
}
}
@ -953,31 +953,31 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
params = params & 0x7FFF;
if (fromActor != NULL) {
if (fromActor->unk_116) {
if (fromActor->unk_116 & 0x01) {
if (fromActor->dropFlag) {
if (fromActor->dropFlag & 0x01) {
params = 1 * 0x10;
dropTableIndex = 0xB;
} else if (fromActor->unk_116 & 0x02) {
dropTableIndex = 11;
} else if (fromActor->dropFlag & 0x02) {
params = 1 * 0x10;
dropTableIndex = 0x6;
} else if (fromActor->unk_116 & 0x04) {
dropTableIndex = 6;
} else if (fromActor->dropFlag & 0x04) {
params = 6 * 0x10;
dropTableIndex = 0x9;
} else if (fromActor->unk_116 & 0x08) {
dropTableIndex = 9;
} else if (fromActor->dropFlag & 0x08) {
params = 3 * 0x10;
dropTableIndex = 0xB;
} else if (fromActor->unk_116 & 0x10) {
dropTableIndex = 11;
} else if (fromActor->dropFlag & 0x10) {
params = 6 * 0x10;
dropTableIndex = 0xC;
} else if (fromActor->unk_116 & 0x20) {
dropTableIndex = 12;
} else if (fromActor->dropFlag & 0x20) {
params = 0 * 0x10;
dropTableIndex = 0x0;
} else if (fromActor->unk_116 & 0x40) {
dropTableIndex = 0;
} else if (fromActor->dropFlag & 0x40) {
params = 0 * 0x10;
dropTableIndex = 0x1;
dropTableIndex = 1;
}
}
if (fromActor->unk_116 & 0x20) {
if (fromActor->dropFlag & 0x20) {
dropId = ITEM00_RUPEE_PURPLE;
} else {
dropId = D_80115574[params + dropTableIndex];
@ -1043,7 +1043,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
spawnedActor->actor.velocity.y = 8.0f;
spawnedActor->actor.speedXZ = 2.0f;
spawnedActor->actor.gravity = -0.9f;
spawnedActor->actor.posRot.rot.y = Rand_ZeroOne() * 40000.0f;
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
Actor_SetScale(&spawnedActor->actor, 0.0f);
EnItem00_SetupAction(spawnedActor, func_8001E304);
spawnedActor->actor.flags |= 0x0010;

View file

@ -48,10 +48,9 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
};
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
player->rideActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x,
player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x,
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.world.pos.x,
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x,
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
}
@ -167,7 +166,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
}
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7);
spawnPos.z, 0, player->actor.world.rot.y, 0, 7);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
}
@ -203,14 +202,14 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
(((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) {
if (D_8011F9B8[i].type == 7) {
if ((globalCtx->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) {
D_8011F9B8[i].pos.x = player->actor.posRot.pos.x;
D_8011F9B8[i].pos.y = player->actor.posRot.pos.y;
D_8011F9B8[i].pos.z = player->actor.posRot.pos.z;
D_8011F9B8[i].pos.x = player->actor.world.pos.x;
D_8011F9B8[i].pos.y = player->actor.world.pos.y;
D_8011F9B8[i].pos.z = player->actor.world.pos.z;
}
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
player->actor.world.rot.y, 0, D_8011F9B8[i].type);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
}
@ -233,20 +232,20 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
__assert("player->ride.actor != NULL", "../z_horse.c", 667);
}
player->actor.posRot.pos.x = D_8011F9B8[i].pos.x;
player->actor.posRot.pos.y = D_8011F9B8[i].pos.y;
player->actor.posRot.pos.z = D_8011F9B8[i].pos.z;
player->actor.world.pos.x = D_8011F9B8[i].pos.x;
player->actor.world.pos.y = D_8011F9B8[i].pos.y;
player->actor.world.pos.z = D_8011F9B8[i].pos.z;
player->actor.shape.rot.x = player->actor.shape.rot.z = 0;
player->actor.shape.rot.y = D_8011F9B8[i].angle;
func_8002DECC(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
sp54.x = player->actor.posRot.pos.x - 200.0f;
sp54.y = player->actor.posRot.pos.y + 100.0f;
sp54.z = player->actor.posRot.pos.z;
sp54.x = player->actor.world.pos.x - 200.0f;
sp54.y = player->actor.world.pos.y + 100.0f;
sp54.z = player->actor.world.pos.z;
Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.posRot.pos, &sp54);
Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.world.pos, &sp54);
} else {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x,
D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0,
@ -284,15 +283,15 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player) {
}
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y;
s16 x = Math_Vec3f_Yaw(&actor->world.pos, arg1) - actor->world.rot.y;
if (x > arg2) {
actor->posRot.rot.y += arg2;
actor->world.rot.y += arg2;
} else if (x < -arg2) {
actor->posRot.rot.y -= arg2;
actor->world.rot.y -= arg2;
} else {
actor->posRot.rot.y += x;
actor->world.rot.y += x;
}
actor->shape.rot.y = actor->posRot.rot.y;
actor->shape.rot.y = actor->world.rot.y;
}

View file

@ -11,8 +11,8 @@ s16 sEntranceIconMapIndex = 0;
void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) {
Player* player = PLAYER;
sPlayerInitialPosX = player->actor.posRot.pos.x;
sPlayerInitialPosZ = player->actor.posRot.pos.z;
sPlayerInitialPosX = player->actor.world.pos.x;
sPlayerInitialPosZ = player->actor.world.pos.z;
sPlayerInitialDirection = (s16)((0x7FFF - player->actor.shape.rot.y) / 0x400);
}
@ -326,8 +326,8 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
tempX = player->actor.posRot.pos.x;
tempZ = player->actor.posRot.pos.z;
tempX = player->actor.world.pos.x;
tempZ = player->actor.world.pos.z;
tempX /= R_COMPASS_SCALE_X;
tempZ /= R_COMPASS_SCALE_Y;
Matrix_Translate((R_COMPASS_OFFSET_X + tempX) / 10.0f, (R_COMPASS_OFFSET_Y - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
@ -531,7 +531,7 @@ void Map_Update(GlobalContext* globalCtx) {
}
for (floor = 0; floor < 8; floor++) {
if (player->actor.posRot.pos.y > gMapData->floorCoordY[mapIndex][floor]) {
if (player->actor.world.pos.y > gMapData->floorCoordY[mapIndex][floor]) {
break;
}
}

View file

@ -24,8 +24,8 @@ f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw) {
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos = &pointPos[waypoint];
dx = pointPos->x - actor->posRot.pos.x;
dz = pointPos->z - actor->posRot.pos.z;
dx = pointPos->x - actor->world.pos.x;
dz = pointPos->z - actor->world.pos.z;
*yaw = Math_FAtan2F(dx, dz) * (32768 / M_PI);

View file

@ -1594,9 +1594,9 @@ s32 Gameplay_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3
player = camera->player;
if (player != NULL) {
camera->posOffset.x = at->x - player->actor.posRot.pos.x;
camera->posOffset.y = at->y - player->actor.posRot.pos.y;
camera->posOffset.z = at->z - player->actor.posRot.pos.z;
camera->posOffset.x = at->x - player->actor.world.pos.x;
camera->posOffset.y = at->y - player->actor.world.pos.y;
camera->posOffset.z = at->z - player->actor.world.pos.z;
} else {
camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f;
}
@ -1622,9 +1622,9 @@ s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Ve
player = camera->player;
if (player != NULL) {
camera->posOffset.x = at->x - player->actor.posRot.pos.x;
camera->posOffset.y = at->y - player->actor.posRot.pos.y;
camera->posOffset.z = at->z - player->actor.posRot.pos.z;
camera->posOffset.x = at->x - player->actor.world.pos.x;
camera->posOffset.y = at->y - player->actor.world.pos.y;
camera->posOffset.z = at->z - player->actor.world.pos.z;
} else {
camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f;
}
@ -1748,7 +1748,7 @@ void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 p
roomIndex = globalCtx->roomCtx.curRoom.num;
entranceIndex = gSaveContext.entranceIndex;
Gameplay_SetRespawnData(globalCtx, respawnMode, entranceIndex, roomIndex, playerParams,
&player->actor.posRot.pos, player->actor.shape.rot.y);
&player->actor.world.pos, player->actor.shape.rot.y);
}
}
@ -1797,7 +1797,7 @@ s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) {
TransitionActorEntry* transitionActor;
s32 frontRoom;
if (actor->type != ACTORTYPE_DOOR) {
if (actor->category != ACTORCAT_DOOR) {
return 0;
}

View file

@ -19,7 +19,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Player_InitVars = {
ACTOR_PLAYER,
ACTORTYPE_PLAYER,
ACTORCAT_PLAYER,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(Player),

View file

@ -389,7 +389,7 @@ void func_8008EDF0(Player* this) {
void func_8008EE08(Player* this) {
if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x8A00000) ||
(!(this->stateFlags1 & 0xC0000) && ((this->actor.posRot.pos.y - this->actor.groundY) < 100.0f))) {
(!(this->stateFlags1 & 0xC0000) && ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) {
this->stateFlags1 &= ~0x400F8000;
} else if (!(this->stateFlags1 & 0x2C0000)) {
this->stateFlags1 |= 0x80000;
@ -1215,11 +1215,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
if (this->actor.scale.y >= 0.0f) {
if (!Player_HoldsHookshot(this) && ((hookedActor = this->heldActor) != NULL)) {
if (this->stateFlags1 & 0x200) {
Matrix_MultVec3f(&D_80126128, &hookedActor->posRot.pos);
Matrix_MultVec3f(&D_80126128, &hookedActor->world.pos);
Matrix_RotateRPY(0x69E8, -0x5708, 0x458E, MTXMODE_APPLY);
Matrix_Get(&sp14C);
func_800D20CC(&sp14C, &hookedActor->posRot.rot, 0);
hookedActor->shape.rot = hookedActor->posRot.rot;
func_800D20CC(&sp14C, &hookedActor->world.rot, 0);
hookedActor->shape.rot = hookedActor->world.rot;
} else if (this->stateFlags1 & 0x800) {
Vec3s spB8;
@ -1227,10 +1227,9 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
func_800D20CC(&sp14C, &spB8, 0);
if (hookedActor->flags & 0x20000) {
hookedActor->posRot.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x;
hookedActor->world.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x;
} else {
hookedActor->posRot.rot.y = hookedActor->shape.rot.y =
this->actor.shape.rot.y + this->unk_3BC.y;
hookedActor->world.rot.y = hookedActor->shape.rot.y = this->actor.shape.rot.y + this->unk_3BC.y;
}
}
} else {
@ -1298,11 +1297,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
MtxF sp44;
s32 pad;
Matrix_MultVec3f(&D_80126190, &heldActor->posRot.pos);
Matrix_MultVec3f(&D_80126190, &heldActor->world.pos);
Matrix_RotateRPY(0, -0x4000, -0x4000, MTXMODE_APPLY);
Matrix_Get(&sp44);
func_800D20CC(&sp44, &heldActor->posRot.rot, 0);
heldActor->shape.rot = heldActor->posRot.rot;
func_800D20CC(&sp44, &heldActor->world.rot, 0);
heldActor->shape.rot = heldActor->world.rot;
if (func_8002DD78(this) != 0) {
Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY);
@ -1322,7 +1321,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
if (this->unk_862 == 0) {
Math_Vec3f_Copy(&heldActor->posRot.pos, &sGetItemRefPos);
Math_Vec3f_Copy(&heldActor->world.pos, &sGetItemRefPos);
}
}
}
@ -1337,11 +1336,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
Matrix_Get(&this->shieldMf);
}
} else if (limbIndex == PLAYER_LIMB_HEAD) {
Matrix_MultVec3f(&D_801260D4, &this->actor.posRot2.pos);
Matrix_MultVec3f(&D_801260D4, &this->actor.focus.pos);
} else {
Vec3f* vec = &D_801261E0[(0, gSaveContext.linkAge)];
func_8002BDB0(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec);
Actor_SetFeetPos(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec);
}
}
}

View file

@ -1054,9 +1054,9 @@ void AnimationContext_MoveActor(GlobalContext* globalCtx, AnimationEntryData* da
Vec3f diff;
SkelAnime_UpdateTranslation(entry->skelAnime, &diff, actor->shape.rot.y);
actor->posRot.pos.x += diff.x * actor->scale.x;
actor->posRot.pos.y += diff.y * actor->scale.y * entry->unk_08;
actor->posRot.pos.z += diff.z * actor->scale.z;
actor->world.pos.x += diff.x * actor->scale.x;
actor->world.pos.y += diff.y * actor->scale.y * entry->unk_08;
actor->world.pos.z += diff.z * actor->scale.z;
}
/**