mirror of https://github.com/zeldaret/oot.git
Offset
This commit is contained in:
parent
ef33445915
commit
2fccfc18f6
|
@ -1509,21 +1509,21 @@ void Player_UpdateShieldCollider(PlayState* play, Player* this, ColliderQuad* co
|
||||||
}
|
}
|
||||||
|
|
||||||
// Positions for the tip of melee weapons, in the left hand limb's own model space.
|
// Positions for the tip of melee weapons, in the left hand limb's own model space.
|
||||||
Vec3f sMeleeWeaponTipLeftHandLimbModelPos0 = { 5000.0f, 400.0f, 0.0f };
|
Vec3f sMeleeWeaponTipOffsetFromLeftHand0 = { 5000.0f, 400.0f, 0.0f };
|
||||||
Vec3f sMeleeWeaponTipLeftHandLimbModelPos1 = { 5000.0f, -400.0f, 1000.0f };
|
Vec3f sMeleeWeaponTipOffsetFromLeftHand1 = { 5000.0f, -400.0f, 1000.0f };
|
||||||
Vec3f sMeleeWeaponTipLeftHandLimbModelPos2 = { 5000.0f, 1400.0f, -1000.0f };
|
Vec3f sMeleeWeaponTipOffsetFromLeftHand2 = { 5000.0f, 1400.0f, -1000.0f };
|
||||||
|
|
||||||
// Positions for the base of melee weapons, in the left hand limb's own model space.
|
// Positions for the base of melee weapons, in the left hand limb's own model space.
|
||||||
Vec3f sMeleeWeaponBaseLeftHandLimbModelPos0 = { 0.0f, 400.0f, 0.0f };
|
Vec3f sMeleeWeaponBaseOffsetFromLeftHand0 = { 0.0f, 400.0f, 0.0f };
|
||||||
Vec3f sMeleeWeaponBaseLeftHandLimbModelPos1 = { 0.0f, 1400.0f, -1000.0f };
|
Vec3f sMeleeWeaponBaseOffsetFromLeftHand1 = { 0.0f, 1400.0f, -1000.0f };
|
||||||
Vec3f sMeleeWeaponBaseLeftHandLimbModelPos2 = { 0.0f, -400.0f, 1000.0f };
|
Vec3f sMeleeWeaponBaseOffsetFromLeftHand2 = { 0.0f, -400.0f, 1000.0f };
|
||||||
|
|
||||||
void Player_UpdateMeleeWeaponInfo(PlayState* play, Player* this, Vec3f* newTipPositions) {
|
void Player_UpdateMeleeWeaponInfo(PlayState* play, Player* this, Vec3f* newTipPositions) {
|
||||||
Vec3f newBasePositions[3];
|
Vec3f newBasePositions[3];
|
||||||
|
|
||||||
Matrix_MultVec3f(&sMeleeWeaponBaseLeftHandLimbModelPos0, &newBasePositions[0]);
|
Matrix_MultVec3f(&sMeleeWeaponBaseOffsetFromLeftHand0, &newBasePositions[0]);
|
||||||
Matrix_MultVec3f(&sMeleeWeaponBaseLeftHandLimbModelPos1, &newBasePositions[1]);
|
Matrix_MultVec3f(&sMeleeWeaponBaseOffsetFromLeftHand1, &newBasePositions[1]);
|
||||||
Matrix_MultVec3f(&sMeleeWeaponBaseLeftHandLimbModelPos2, &newBasePositions[2]);
|
Matrix_MultVec3f(&sMeleeWeaponBaseOffsetFromLeftHand2, &newBasePositions[2]);
|
||||||
|
|
||||||
if (Player_UpdateWeaponInfo(play, NULL, &this->meleeWeaponInfo[0], &newTipPositions[0], &newBasePositions[0]) &&
|
if (Player_UpdateWeaponInfo(play, NULL, &this->meleeWeaponInfo[0], &newTipPositions[0], &newBasePositions[0]) &&
|
||||||
!(this->stateFlags1 & PLAYER_STATE1_SHIELDING)) {
|
!(this->stateFlags1 & PLAYER_STATE1_SHIELDING)) {
|
||||||
|
@ -1568,19 +1568,19 @@ void Player_DrawGetItem(PlayState* play, Player* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player_CalcMeleeWeaponTipPositions(Player* this, Vec3f* tipPositions) {
|
void Player_CalcMeleeWeaponTipPositions(Player* this, Vec3f* tipPositions) {
|
||||||
sMeleeWeaponTipLeftHandLimbModelPos1.x = sMeleeWeaponTipLeftHandLimbModelPos0.x;
|
sMeleeWeaponTipOffsetFromLeftHand1.x = sMeleeWeaponTipOffsetFromLeftHand0.x;
|
||||||
|
|
||||||
if (this->unk_845 >= 3) {
|
if (this->unk_845 >= 3) {
|
||||||
this->unk_845++;
|
this->unk_845++;
|
||||||
sMeleeWeaponTipLeftHandLimbModelPos1.x *= 1.0f + ((9 - this->unk_845) * 0.1f);
|
sMeleeWeaponTipOffsetFromLeftHand1.x *= 1.0f + ((9 - this->unk_845) * 0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
sMeleeWeaponTipLeftHandLimbModelPos1.x += 1200.0f;
|
sMeleeWeaponTipOffsetFromLeftHand1.x += 1200.0f;
|
||||||
sMeleeWeaponTipLeftHandLimbModelPos2.x = sMeleeWeaponTipLeftHandLimbModelPos1.x;
|
sMeleeWeaponTipOffsetFromLeftHand2.x = sMeleeWeaponTipOffsetFromLeftHand1.x;
|
||||||
|
|
||||||
Matrix_MultVec3f(&sMeleeWeaponTipLeftHandLimbModelPos0, &tipPositions[0]);
|
Matrix_MultVec3f(&sMeleeWeaponTipOffsetFromLeftHand0, &tipPositions[0]);
|
||||||
Matrix_MultVec3f(&sMeleeWeaponTipLeftHandLimbModelPos1, &tipPositions[1]);
|
Matrix_MultVec3f(&sMeleeWeaponTipOffsetFromLeftHand1, &tipPositions[1]);
|
||||||
Matrix_MultVec3f(&sMeleeWeaponTipLeftHandLimbModelPos2, &tipPositions[2]);
|
Matrix_MultVec3f(&sMeleeWeaponTipOffsetFromLeftHand2, &tipPositions[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) {
|
void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) {
|
||||||
|
@ -1622,7 +1622,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Coordinates of the player focus position, in the head limb's own model space.
|
// Coordinates of the player focus position, in the head limb's own model space.
|
||||||
Vec3f sPlayerFocusHeadLimbModelPos = { 1100.0f, -700.0f, 0.0f };
|
Vec3f sPlayerFocusOffsetFromHead = { 1100.0f, -700.0f, 0.0f };
|
||||||
|
|
||||||
f32 sMeleeWeaponLengths[] = {
|
f32 sMeleeWeaponLengths[] = {
|
||||||
0.0f, // not a melee weapon
|
0.0f, // not a melee weapon
|
||||||
|
@ -1670,7 +1670,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2633);
|
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2633);
|
||||||
|
|
||||||
if (this->actor.scale.y >= 0.0f) {
|
if (this->actor.scale.y >= 0.0f) {
|
||||||
sMeleeWeaponTipLeftHandLimbModelPos0.x = this->unk_85C * 5000.0f;
|
sMeleeWeaponTipOffsetFromLeftHand0.x = this->unk_85C * 5000.0f;
|
||||||
Player_CalcMeleeWeaponTipPositions(this, tipPositions);
|
Player_CalcMeleeWeaponTipPositions(this, tipPositions);
|
||||||
if (this->meleeWeaponState != 0) {
|
if (this->meleeWeaponState != 0) {
|
||||||
Player_UpdateMeleeWeaponInfo(play, this, tipPositions);
|
Player_UpdateMeleeWeaponInfo(play, this, tipPositions);
|
||||||
|
@ -1691,9 +1691,9 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
|
||||||
Vec3f tipPositions[3];
|
Vec3f tipPositions[3];
|
||||||
|
|
||||||
if (Player_HoldsBrokenKnife(this)) {
|
if (Player_HoldsBrokenKnife(this)) {
|
||||||
sMeleeWeaponTipLeftHandLimbModelPos0.x = 1500.0f;
|
sMeleeWeaponTipOffsetFromLeftHand0.x = 1500.0f;
|
||||||
} else {
|
} else {
|
||||||
sMeleeWeaponTipLeftHandLimbModelPos0.x = sMeleeWeaponLengths[Player_GetMeleeWeaponHeld(this)];
|
sMeleeWeaponTipOffsetFromLeftHand0.x = sMeleeWeaponLengths[Player_GetMeleeWeaponHeld(this)];
|
||||||
}
|
}
|
||||||
|
|
||||||
Player_CalcMeleeWeaponTipPositions(this, tipPositions);
|
Player_CalcMeleeWeaponTipPositions(this, tipPositions);
|
||||||
|
@ -1868,7 +1868,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
|
||||||
Matrix_Get(&this->shieldMf);
|
Matrix_Get(&this->shieldMf);
|
||||||
}
|
}
|
||||||
} else if (limbIndex == PLAYER_LIMB_HEAD) {
|
} else if (limbIndex == PLAYER_LIMB_HEAD) {
|
||||||
Matrix_MultVec3f(&sPlayerFocusHeadLimbModelPos, &this->actor.focus.pos);
|
Matrix_MultVec3f(&sPlayerFocusOffsetFromHead, &this->actor.focus.pos);
|
||||||
} else {
|
} else {
|
||||||
// Position of Link's foot, in the foot limb's own model space.
|
// Position of Link's foot, in the foot limb's own model space.
|
||||||
static Vec3f sLeftRightFootLimbModelFootPos[] = {
|
static Vec3f sLeftRightFootLimbModelFootPos[] = {
|
||||||
|
|
|
@ -429,8 +429,8 @@ void EnArrow_Update(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_809B4800(EnArrow* this, PlayState* play) {
|
void func_809B4800(EnArrow* this, PlayState* play) {
|
||||||
static Vec3f sPosAModel = { 0.0f, 400.0f, 1500.0f };
|
static Vec3f sPosAOffset = { 0.0f, 400.0f, 1500.0f };
|
||||||
static Vec3f sPosBModel = { 0.0f, -400.0f, 1500.0f };
|
static Vec3f sPosBOffset = { 0.0f, -400.0f, 1500.0f };
|
||||||
static Vec3f D_809B4EA0 = { 0.0f, 0.0f, -300.0f };
|
static Vec3f D_809B4EA0 = { 0.0f, 0.0f, -300.0f };
|
||||||
Vec3f posA;
|
Vec3f posA;
|
||||||
Vec3f posB;
|
Vec3f posB;
|
||||||
|
@ -439,8 +439,8 @@ void func_809B4800(EnArrow* this, PlayState* play) {
|
||||||
Matrix_MultVec3f(&D_809B4EA0, &this->unk_21C);
|
Matrix_MultVec3f(&D_809B4EA0, &this->unk_21C);
|
||||||
|
|
||||||
if (EnArrow_Fly == this->actionFunc) {
|
if (EnArrow_Fly == this->actionFunc) {
|
||||||
Matrix_MultVec3f(&sPosAModel, &posA);
|
Matrix_MultVec3f(&sPosAOffset, &posA);
|
||||||
Matrix_MultVec3f(&sPosBModel, &posB);
|
Matrix_MultVec3f(&sPosBOffset, &posB);
|
||||||
|
|
||||||
if (this->actor.params <= ARROW_SEED) {
|
if (this->actor.params <= ARROW_SEED) {
|
||||||
addBlureVertex = this->actor.params <= ARROW_LIGHT;
|
addBlureVertex = this->actor.params <= ARROW_LIGHT;
|
||||||
|
|
|
@ -257,8 +257,8 @@ void EnBoom_Update(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnBoom_Draw(Actor* thisx, PlayState* play) {
|
void EnBoom_Draw(Actor* thisx, PlayState* play) {
|
||||||
static Vec3f sPosAModel = { -960.0f, 0.0f, 0.0f };
|
static Vec3f sPosAOffset = { -960.0f, 0.0f, 0.0f };
|
||||||
static Vec3f sPosBModel = { 960.0f, 0.0f, 0.0f };
|
static Vec3f sPosBOffset = { 960.0f, 0.0f, 0.0f };
|
||||||
EnBoom* this = (EnBoom*)thisx;
|
EnBoom* this = (EnBoom*)thisx;
|
||||||
Vec3f posA;
|
Vec3f posA;
|
||||||
Vec3f posB;
|
Vec3f posB;
|
||||||
|
@ -268,8 +268,8 @@ void EnBoom_Draw(Actor* thisx, PlayState* play) {
|
||||||
Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_APPLY);
|
Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_APPLY);
|
||||||
Matrix_RotateZ(BINANG_TO_RAD(0x1F40), MTXMODE_APPLY);
|
Matrix_RotateZ(BINANG_TO_RAD(0x1F40), MTXMODE_APPLY);
|
||||||
Matrix_RotateX(BINANG_TO_RAD(this->actor.world.rot.x), MTXMODE_APPLY);
|
Matrix_RotateX(BINANG_TO_RAD(this->actor.world.rot.x), MTXMODE_APPLY);
|
||||||
Matrix_MultVec3f(&sPosAModel, &posA);
|
Matrix_MultVec3f(&sPosAOffset, &posA);
|
||||||
Matrix_MultVec3f(&sPosBModel, &posB);
|
Matrix_MultVec3f(&sPosBOffset, &posB);
|
||||||
|
|
||||||
if (Player_UpdateWeaponInfo(play, &this->collider, &this->weaponInfo, &posA, &posB)) {
|
if (Player_UpdateWeaponInfo(play, &this->collider, &this->weaponInfo, &posA, &posB)) {
|
||||||
EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &posA, &posB);
|
EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &posA, &posB);
|
||||||
|
|
|
@ -1514,7 +1514,7 @@ void EnMb_Update(Actor* thisx, PlayState* play) {
|
||||||
void EnMb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
void EnMb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||||
static Vec3f unused = { 1100.0f, -700.0f, 0.0f };
|
static Vec3f unused = { 1100.0f, -700.0f, 0.0f };
|
||||||
static Vec3f feetPos = { 0.0f, 0.0f, 0.0f };
|
static Vec3f feetPos = { 0.0f, 0.0f, 0.0f };
|
||||||
static Vec3f effSpawnModelPos = { 0.0f, -8000.0f, 0.0f };
|
static Vec3f effSpawnOffsetFromLeftHand = { 0.0f, -8000.0f, 0.0f };
|
||||||
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
|
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
|
||||||
s32 bodyPart = -1;
|
s32 bodyPart = -1;
|
||||||
EnMb* this = (EnMb*)thisx;
|
EnMb* this = (EnMb*)thisx;
|
||||||
|
@ -1522,7 +1522,7 @@ void EnMb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
||||||
|
|
||||||
if (this->actor.params == ENMB_TYPE_CLUB) {
|
if (this->actor.params == ENMB_TYPE_CLUB) {
|
||||||
if (limbIndex == ENMB_LIMB_LHAND) {
|
if (limbIndex == ENMB_LIMB_LHAND) {
|
||||||
Matrix_MultVec3f(&effSpawnModelPos, &this->effSpawnPos);
|
Matrix_MultVec3f(&effSpawnOffsetFromLeftHand, &this->effSpawnPos);
|
||||||
if (this->attack > ENMB_ATTACK_NONE) {
|
if (this->attack > ENMB_ATTACK_NONE) {
|
||||||
EnMb_ClubUpdateAttackCollider(&this->actor, play);
|
EnMb_ClubUpdateAttackCollider(&this->actor, play);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue