mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 15:04:31 +00:00
Angle cleanup - macros names (#1193)
* Move binang utility macros out of angle conversion macros block
* `BINANG_TO_DEGF` -> `BINANG_TO_DEG_ALT` (it may even be warranted to name it _approx instead of _alt, unsure)
* Add `BINANG_TO_DEG` (unused by oot) (for completeness)
* `DEGF_TO_BINANG` -> `DEG_TO_BINANG_ALT` (again may even be _approx, or maybe _cam)
* Add `DEG_TO_BINANG` (unused by oot) (for completeness)
* `RADF_TO_BINANG` -> `RAD_TO_BINANG`
* `RADF_TO_DEGF` -> `RAD_TO_DEG`
* Cleanup argument names in angle conversion macros
* Format for angle macros changes
* Run formatter
* Move `DEG_TO_BINANG_ALT`, `BINANG_TO_DEG_ALT` to z64camera.h
* Remove `DEG_TO_BINANG`, `BINANG_TO_DEG`
* Remove `_ALT` from `DEG_TO_BINANG`, `BINANG_TO_DEG`
* Add comment about inaccuracy near `DEG_TO_BINANG`, `BINANG_TO_DEG`
* run formatter
* `CAM_` prefix on `DEG_TO_BINANG`, `BINANG_TO_DEG` macros
* Revert "Remove `DEG_TO_BINANG`, `BINANG_TO_DEG`"
This reverts commit 5321647e5b
.
This commit is contained in:
parent
ef870bdd11
commit
fed9ac3e20
52 changed files with 219 additions and 213 deletions
|
@ -957,8 +957,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
|||
} else {
|
||||
temp_f0_5 = sGlobalCtx->state.input[2].rel.stick_y;
|
||||
temp_f2_2 = sGlobalCtx->state.input[2].rel.stick_x;
|
||||
pitch = DEGF_TO_BINANG((SQ(temp_f0_5) / 600.0f) * 0.8f);
|
||||
yaw = DEGF_TO_BINANG((SQ(temp_f2_2) / 600.0f) * 0.8f);
|
||||
pitch = CAM_DEG_TO_BINANG((SQ(temp_f0_5) / 600.0f) * 0.8f);
|
||||
yaw = CAM_DEG_TO_BINANG((SQ(temp_f2_2) / 600.0f) * 0.8f);
|
||||
if (!D_80161144) {
|
||||
sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? pitch : -pitch);
|
||||
sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? yaw : -yaw);
|
||||
|
@ -974,7 +974,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
|||
}
|
||||
|
||||
OLib_Vec3fDiffToVecSphGeo(&spF4, sp80, sp7C);
|
||||
DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, spF4.pitch, spF4.yaw, DEGF_TO_BINANG(dbCamera->rollDegrees));
|
||||
DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, spF4.pitch, spF4.yaw,
|
||||
CAM_DEG_TO_BINANG(dbCamera->rollDegrees));
|
||||
if (dbCamera->unk_00 == 1) {
|
||||
if (CHECK_BTN_ALL(sGlobalCtx->state.input[2].cur.button, BTN_CRIGHT)) {
|
||||
cam->inputDir = dbCamera->sub.unk_104A;
|
||||
|
@ -1100,9 +1101,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
|||
dbCamera->unk_3C = false;
|
||||
if (dbCamera->sub.mode != 1) {
|
||||
func_8006376C(0xD, 0x18, 3, !D_80161144 ? D_8012CF04 : D_8012CF08);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(sp104.pitch), &D_8012D0E4[11], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.pitch), &D_8012D0E4[11], 4);
|
||||
func_8006376C(0xF, 0x17, 3, D_8012D0E4);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(sp104.yaw), &D_8012D0F8[11], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.yaw), &D_8012D0F8[11], 4);
|
||||
func_8006376C(0xF, 0x18, 3, D_8012D0F8);
|
||||
DbCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6);
|
||||
func_8006376C(0xF, 0x19, 3, D_8012D0D4);
|
||||
|
@ -1375,9 +1376,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
|||
: !D_80161144 ? 4
|
||||
: 3,
|
||||
D_8012CF30);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(spFC.pitch), &D_8012D0E4[10], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.pitch), &D_8012D0E4[10], 4);
|
||||
func_8006376C(3, 0x17, 3, D_8012D0E4);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(spFC.yaw), &D_8012D0F8[10], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.yaw), &D_8012D0F8[10], 4);
|
||||
func_8006376C(3, 0x18, 3, D_8012D0F8);
|
||||
DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6);
|
||||
func_8006376C(3, 0x19, 3, D_8012D0D4);
|
||||
|
@ -1388,9 +1389,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
|||
: D_80161144 ? 4
|
||||
: 3,
|
||||
D_8012CF34);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(spFC.pitch), &D_8012D0E4[10], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.pitch), &D_8012D0E4[10], 4);
|
||||
func_8006376C(0x1C, 0x17, 3, D_8012D0E4);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(spFC.yaw), &D_8012D0F8[10], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.yaw), &D_8012D0F8[10], 4);
|
||||
func_8006376C(0x1C, 0x18, 3, D_8012D0F8);
|
||||
DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6);
|
||||
func_8006376C(0x1C, 0x19, 3, D_8012D0D4);
|
||||
|
@ -1464,9 +1465,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
|
|||
DbCamera_SetTextValue(dbCamera->eye.z, &sp111, 6);
|
||||
func_8006376C(0x1E, 0x19, 2, &sp110);
|
||||
func_8006376C(0xD, 0x18, 3, !D_80161144 ? D_8012CF04 : D_8012CF08);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(sp104.pitch), &D_8012D0E4[11], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.pitch), &D_8012D0E4[11], 4);
|
||||
func_8006376C(0xF, 0x17, 3, D_8012D0E4);
|
||||
DbCamera_SetTextValue(BINANG_TO_DEGF(sp104.yaw), &D_8012D0F8[11], 4);
|
||||
DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.yaw), &D_8012D0F8[11], 4);
|
||||
func_8006376C(0xF, 0x18, 3, D_8012D0F8);
|
||||
DbCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6);
|
||||
func_8006376C(0xF, 0x19, 3, D_8012D0D4);
|
||||
|
@ -2148,7 +2149,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
|
|||
}
|
||||
OLib_Vec3fDiffToVecSphGeo(&sp5C, &dbCamera->eye, &dbCamera->at);
|
||||
DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, sp5C.pitch, sp5C.yaw,
|
||||
DEGF_TO_BINANG(dbCamera->rollDegrees));
|
||||
CAM_DEG_TO_BINANG(dbCamera->rollDegrees));
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
|
|
@ -769,17 +769,17 @@ void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
|
|||
temp = mf->xz;
|
||||
temp *= temp;
|
||||
temp += SQ(mf->zz);
|
||||
rotDest->x = RADF_TO_BINANG(Math_FAtan2F(-mf->yz, sqrtf(temp)));
|
||||
rotDest->x = RAD_TO_BINANG(Math_FAtan2F(-mf->yz, sqrtf(temp)));
|
||||
|
||||
if ((rotDest->x == 0x4000) || (rotDest->x == -0x4000)) {
|
||||
rotDest->z = 0;
|
||||
|
||||
rotDest->y = RADF_TO_BINANG(Math_FAtan2F(-mf->zx, mf->xx));
|
||||
rotDest->y = RAD_TO_BINANG(Math_FAtan2F(-mf->zx, mf->xx));
|
||||
} else {
|
||||
rotDest->y = RADF_TO_BINANG(Math_FAtan2F(mf->xz, mf->zz));
|
||||
rotDest->y = RAD_TO_BINANG(Math_FAtan2F(mf->xz, mf->zz));
|
||||
|
||||
if (!flag) {
|
||||
rotDest->z = RADF_TO_BINANG(Math_FAtan2F(mf->yx, mf->yy));
|
||||
rotDest->z = RAD_TO_BINANG(Math_FAtan2F(mf->yx, mf->yy));
|
||||
} else {
|
||||
temp = mf->xx;
|
||||
temp2 = mf->zx;
|
||||
|
@ -804,7 +804,7 @@ void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
|
|||
|
||||
/* for a rotation matrix, temp == yx and temp2 == yy
|
||||
* which is the same as in the !flag branch */
|
||||
rotDest->z = RADF_TO_BINANG(Math_FAtan2F(temp, temp2));
|
||||
rotDest->z = RAD_TO_BINANG(Math_FAtan2F(temp, temp2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -822,16 +822,16 @@ void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
|
|||
temp = mf->xx;
|
||||
temp *= temp;
|
||||
temp += SQ(mf->yx);
|
||||
rotDest->y = RADF_TO_BINANG(Math_FAtan2F(-mf->zx, sqrtf(temp)));
|
||||
rotDest->y = RAD_TO_BINANG(Math_FAtan2F(-mf->zx, sqrtf(temp)));
|
||||
|
||||
if ((rotDest->y == 0x4000) || (rotDest->y == -0x4000)) {
|
||||
rotDest->x = 0;
|
||||
rotDest->z = RADF_TO_BINANG(Math_FAtan2F(-mf->xy, mf->yy));
|
||||
rotDest->z = RAD_TO_BINANG(Math_FAtan2F(-mf->xy, mf->yy));
|
||||
} else {
|
||||
rotDest->z = RADF_TO_BINANG(Math_FAtan2F(mf->yx, mf->xx));
|
||||
rotDest->z = RAD_TO_BINANG(Math_FAtan2F(mf->yx, mf->xx));
|
||||
|
||||
if (!flag) {
|
||||
rotDest->x = RADF_TO_BINANG(Math_FAtan2F(mf->zy, mf->zz));
|
||||
rotDest->x = RAD_TO_BINANG(Math_FAtan2F(mf->zy, mf->zz));
|
||||
} else {
|
||||
// see Matrix_MtxFToYXZRotS
|
||||
temp = mf->xy;
|
||||
|
@ -853,7 +853,7 @@ void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag) {
|
|||
temp2 = sqrtf(temp2);
|
||||
temp2 = temp3 / temp2;
|
||||
|
||||
rotDest->x = RADF_TO_BINANG(Math_FAtan2F(temp, temp2));
|
||||
rotDest->x = RAD_TO_BINANG(Math_FAtan2F(temp, temp2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4181,12 +4181,12 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) {
|
|||
sp38 = Math_SinS(arg1);
|
||||
sp34 = Math_CosS(arg1);
|
||||
sp28 = (-(floorPolyNormalX * sp38) - (floorPolyNormalZ * sp34));
|
||||
arg2->x = -RADF_TO_BINANG(Math_FAtan2F(sp28 * floorPolyNormalY, 1.0f));
|
||||
arg2->x = -RAD_TO_BINANG(Math_FAtan2F(sp28 * floorPolyNormalY, 1.0f));
|
||||
|
||||
sp2C = Math_SinS(arg1 - 16375);
|
||||
sp30 = Math_CosS(arg1 - 16375);
|
||||
sp24 = (-(floorPolyNormalX * sp2C) - (floorPolyNormalZ * sp30));
|
||||
arg2->z = -RADF_TO_BINANG(Math_FAtan2F(sp24 * floorPolyNormalY, 1.0f));
|
||||
arg2->z = -RAD_TO_BINANG(Math_FAtan2F(sp24 * floorPolyNormalY, 1.0f));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -565,7 +565,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
|
|||
* Calculates the angle between points `from` and `to`
|
||||
*/
|
||||
s16 Camera_XZAngle(Vec3f* to, Vec3f* from) {
|
||||
return DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(from->x - to->x, from->z - to->z)));
|
||||
return CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(from->x - to->x, from->z - to->z)));
|
||||
}
|
||||
|
||||
s16 func_80044ADC(Camera* camera, s16 yaw, s16 arg2) {
|
||||
|
@ -630,8 +630,8 @@ s16 func_80044ADC(Camera* camera, s16 yaw, s16 arg2) {
|
|||
}
|
||||
phi_f16 = PCT(OREG(20)) * (D_8015CE50 - camera->playerGroundY);
|
||||
phi_f18 = (1.0f - PCT(OREG(20))) * (D_8015CE54 - camera->playerGroundY);
|
||||
temp_s0 = DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(phi_f16, sp30)));
|
||||
temp_s1 = DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(phi_f18, sp2C)));
|
||||
temp_s0 = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(phi_f16, sp30)));
|
||||
temp_s1 = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(phi_f18, sp2C)));
|
||||
return temp_s0 + temp_s1;
|
||||
}
|
||||
|
||||
|
@ -1440,7 +1440,7 @@ s32 Camera_Normal1(Camera* camera) {
|
|||
norm1->yOffset = NEXTSETTING * sp94;
|
||||
norm1->distMin = NEXTSETTING * sp94;
|
||||
norm1->distMax = NEXTSETTING * sp94;
|
||||
norm1->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
norm1->pitchTarget = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
norm1->unk_0C = NEXTSETTING;
|
||||
norm1->unk_10 = NEXTSETTING;
|
||||
norm1->unk_14 = NEXTPCT;
|
||||
|
@ -1672,7 +1672,7 @@ s32 Camera_Normal2(Camera* camera) {
|
|||
norm2->unk_00 = NEXTPCT * playerHeight * yNormal;
|
||||
norm2->unk_04 = NEXTPCT * playerHeight * yNormal;
|
||||
norm2->unk_08 = NEXTPCT * playerHeight * yNormal;
|
||||
norm2->unk_1C = DEGF_TO_BINANG(NEXTSETTING);
|
||||
norm2->unk_1C = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
norm2->unk_0C = NEXTSETTING;
|
||||
norm2->unk_10 = NEXTPCT;
|
||||
norm2->unk_14 = NEXTSETTING;
|
||||
|
@ -1830,7 +1830,7 @@ s32 Camera_Normal3(Camera* camera) {
|
|||
norm3->yOffset = NEXTSETTING * PCT(playerHeight);
|
||||
norm3->distMin = NEXTSETTING * PCT(playerHeight);
|
||||
norm3->distMax = NEXTSETTING * PCT(playerHeight);
|
||||
norm3->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
norm3->pitchTarget = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
norm3->yawUpdateSpeed = NEXTSETTING;
|
||||
norm3->unk_10 = NEXTSETTING;
|
||||
norm3->fovTarget = NEXTSETTING;
|
||||
|
@ -1982,8 +1982,8 @@ s32 Camera_Parallel1(Camera* camera) {
|
|||
|
||||
para1->yOffset = NEXTPCT * playerHeight * yNormal;
|
||||
para1->distTarget = NEXTPCT * playerHeight * yNormal;
|
||||
para1->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
para1->yawTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
para1->pitchTarget = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
para1->yawTarget = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
para1->unk_08 = NEXTSETTING;
|
||||
para1->unk_0C = NEXTSETTING;
|
||||
para1->fovTarget = NEXTSETTING;
|
||||
|
@ -2544,7 +2544,7 @@ s32 Camera_Jump3(Camera* camera) {
|
|||
jump3->yOffset = NEXTSETTING * t2;
|
||||
jump3->distMin = NEXTSETTING * t2;
|
||||
jump3->distMax = NEXTSETTING * t2;
|
||||
jump3->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
jump3->pitchTarget = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
jump3->swingUpdateRate = NEXTSETTING;
|
||||
jump3->unk_10 = NEXTSETTING;
|
||||
jump3->unk_14 = NEXTPCT;
|
||||
|
@ -2880,25 +2880,25 @@ s32 Camera_Battle1(Camera* camera) {
|
|||
skipEyeAtCalc = true;
|
||||
}
|
||||
anim->animTimer--;
|
||||
} else if (ABS(tmpAng1) > DEGF_TO_BINANG(swingAngle)) {
|
||||
spFC = BINANG_TO_DEGF(tmpAng1);
|
||||
} else if (ABS(tmpAng1) > CAM_DEG_TO_BINANG(swingAngle)) {
|
||||
spFC = CAM_BINANG_TO_DEG(tmpAng1);
|
||||
temp_f2_2 = swingAngle + (spF8 - swingAngle) * (OLib_ClampMaxDist(atToTargetDir.r, spB4.r) / spB4.r);
|
||||
temp_f12_2 = ((temp_f2_2 * temp_f2_2) - 2.0f) / (temp_f2_2 - 360.0f);
|
||||
var2 = ((temp_f12_2 * spFC) + (2.0f - (360.0f * temp_f12_2)));
|
||||
temp_f14 = SQ(spFC) / var2;
|
||||
tmpAng2 = tmpAng1 >= 0 ? DEGF_TO_BINANG(temp_f14) : (-DEGF_TO_BINANG(temp_f14));
|
||||
tmpAng2 = tmpAng1 >= 0 ? CAM_DEG_TO_BINANG(temp_f14) : (-CAM_DEG_TO_BINANG(temp_f14));
|
||||
spB4.yaw = BINANG_ROT180((s16)(BINANG_ROT180(atToEyeNextDir.yaw) + tmpAng2));
|
||||
} else {
|
||||
spFC = 0.05f;
|
||||
spFC = (1 - camera->speedRatio) * spFC;
|
||||
tmpAng2 = tmpAng1 >= 0 ? DEGF_TO_BINANG(swingAngle) : -DEGF_TO_BINANG(swingAngle);
|
||||
tmpAng2 = tmpAng1 >= 0 ? CAM_DEG_TO_BINANG(swingAngle) : -CAM_DEG_TO_BINANG(swingAngle);
|
||||
spB4.yaw = atToEyeNextDir.yaw - (s16)((tmpAng2 - tmpAng1) * spFC);
|
||||
}
|
||||
|
||||
if (!skipEyeAtCalc) {
|
||||
var3 = atToTargetDir.pitch * batt1->swingPitchAdj;
|
||||
var2 = F32_LERPIMP(sp7C, sp78, distRatio);
|
||||
tmpAng1 = DEGF_TO_BINANG(var2) - (s16)(playerToTargetDir.pitch * (0.5f + distRatio * (1.0f - 0.5f)));
|
||||
tmpAng1 = CAM_DEG_TO_BINANG(var2) - (s16)(playerToTargetDir.pitch * (0.5f + distRatio * (1.0f - 0.5f)));
|
||||
tmpAng1 += (s16)(var3);
|
||||
|
||||
if (tmpAng1 < -0x2AA8) {
|
||||
|
@ -2927,7 +2927,7 @@ s32 Camera_Battle1(Camera* camera) {
|
|||
}
|
||||
}
|
||||
anim->roll += (((OREG(36) * camera->speedRatio) * (1.0f - distRatio)) - anim->roll) * PCT(OREG(37));
|
||||
camera->roll = DEGF_TO_BINANG(anim->roll);
|
||||
camera->roll = CAM_DEG_TO_BINANG(anim->roll);
|
||||
camera->fov = Camera_LERPCeilF((player->meleeWeaponState != 0 ? 0.8f
|
||||
: gSaveContext.health <= 0x10 ? 0.8f
|
||||
: 1.0f) *
|
||||
|
@ -2967,7 +2967,7 @@ s32 Camera_Battle4(Camera* camera) {
|
|||
|
||||
batt4->yOffset = NEXTPCT * playerHeight * yNormal;
|
||||
batt4->rTarget = NEXTPCT * playerHeight * yNormal;
|
||||
batt4->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
batt4->pitchTarget = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
batt4->lerpUpdateRate = NEXTPCT;
|
||||
batt4->fovTarget = NEXTSETTING;
|
||||
batt4->atLERPTarget = NEXTPCT;
|
||||
|
@ -3206,23 +3206,23 @@ s32 Camera_KeepOn1(Camera* camera) {
|
|||
sp88 = 1;
|
||||
}
|
||||
anim->unk_16--;
|
||||
} else if (ABS(spE2) > DEGF_TO_BINANG(spEC)) {
|
||||
spF4 = BINANG_TO_DEGF(spE2);
|
||||
} else if (ABS(spE2) > CAM_DEG_TO_BINANG(spEC)) {
|
||||
spF4 = CAM_BINANG_TO_DEG(spE2);
|
||||
t2 = spEC + (spF0 - spEC) * (OLib_ClampMaxDist(spD0.r, spD8.r) / spD8.r);
|
||||
temp_f12_2 = ((SQ(t2) - 2.0f) / (t2 - 360.0f));
|
||||
t1 = (temp_f12_2 * spF4) + (2.0f - (360.0f * temp_f12_2));
|
||||
temp_f14 = SQ(spF4) / t1;
|
||||
spE0 = spE2 >= 0 ? (DEGF_TO_BINANG(temp_f14)) : (-DEGF_TO_BINANG(temp_f14));
|
||||
spE0 = spE2 >= 0 ? (CAM_DEG_TO_BINANG(temp_f14)) : (-CAM_DEG_TO_BINANG(temp_f14));
|
||||
spD8.yaw = BINANG_ROT180((s16)(BINANG_ROT180(spB8.yaw) + spE0));
|
||||
} else {
|
||||
spF4 = 0.02f;
|
||||
spF4 = (1.0f - camera->speedRatio) * spF4;
|
||||
spE0 = spE2 >= 0 ? DEGF_TO_BINANG(spEC) : -DEGF_TO_BINANG(spEC);
|
||||
spE0 = spE2 >= 0 ? CAM_DEG_TO_BINANG(spEC) : -CAM_DEG_TO_BINANG(spEC);
|
||||
spD8.yaw = spB8.yaw - (s16)((spE0 - spE2) * spF4);
|
||||
}
|
||||
|
||||
if (sp88 == 0) {
|
||||
spE2 = DEGF_TO_BINANG((f32)(keep1->unk_14 + ((keep1->unk_18 - keep1->unk_14) * sp84)));
|
||||
spE2 = CAM_DEG_TO_BINANG((f32)(keep1->unk_14 + ((keep1->unk_18 - keep1->unk_14) * sp84)));
|
||||
spE2 -= (s16)(spC8.pitch * (0.5f + (sp84 * 0.5f)));
|
||||
|
||||
spE8 = spD0.pitch * keep1->unk_1C;
|
||||
|
@ -3351,31 +3351,31 @@ s32 Camera_KeepOn3(Camera* camera) {
|
|||
anim->animTimer = keep3->initTimer;
|
||||
spBC = ((1.0f - temp_f0) * targetToPlayerDir.r) / anim->animTimer;
|
||||
swingAngle = F32_LERPIMP(keep3->swingPitchInitial, keep3->swingPitchFinal, temp_f0);
|
||||
atToEyeAdj.pitch = DEGF_TO_BINANG(swingAngle) + ((s16)(-(targetToPlayerDir.pitch * keep3->swingPitchAdj)));
|
||||
atToEyeAdj.pitch = CAM_DEG_TO_BINANG(swingAngle) + ((s16)(-(targetToPlayerDir.pitch * keep3->swingPitchAdj)));
|
||||
swingAngle = F32_LERPIMP(keep3->swingYawInital, keep3->swingYawFinal, temp_f0);
|
||||
if (keep3->flags & 0x10) {
|
||||
if (BINANG_SUB(targetToPlayerDir.yaw, atToEyeNextDir.yaw) < 0) {
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw + DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw + CAM_DEG_TO_BINANG(swingAngle);
|
||||
} else {
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw - DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw - CAM_DEG_TO_BINANG(swingAngle);
|
||||
}
|
||||
} else if (keep3->flags & 0x20) {
|
||||
if (BINANG_SUB(targetToPlayerDir.yaw, atToEyeNextDir.yaw) < 0) {
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) - DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) - CAM_DEG_TO_BINANG(swingAngle);
|
||||
} else {
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) + DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) + CAM_DEG_TO_BINANG(swingAngle);
|
||||
}
|
||||
} else if (ABS(BINANG_SUB(targetToPlayerDir.yaw, atToEyeNextDir.yaw)) < 0x3FFF) {
|
||||
if (BINANG_SUB(targetToPlayerDir.yaw, atToEyeNextDir.yaw) < 0) {
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw + DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw + CAM_DEG_TO_BINANG(swingAngle);
|
||||
} else {
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw - DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = targetToPlayerDir.yaw - CAM_DEG_TO_BINANG(swingAngle);
|
||||
}
|
||||
} else {
|
||||
if (BINANG_SUB(targetToPlayerDir.yaw, atToEyeNextDir.yaw) < 0) {
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) - DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) - CAM_DEG_TO_BINANG(swingAngle);
|
||||
} else {
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) + DEGF_TO_BINANG(swingAngle);
|
||||
atToEyeAdj.yaw = BINANG_ROT180(targetToPlayerDir.yaw) + CAM_DEG_TO_BINANG(swingAngle);
|
||||
}
|
||||
}
|
||||
prevTargetPlayerDist = targetToPlayerDir.r;
|
||||
|
@ -3634,35 +3634,35 @@ s32 Camera_KeepOn4(Camera* camera) {
|
|||
unk20->unk_10 = keep4->unk_1E;
|
||||
unk20->unk_08 = playerPosRot->pos.y - camera->playerPosDelta.y;
|
||||
if (keep4->unk_1C & 2) {
|
||||
spA2 = DEGF_TO_BINANG(keep4->unk_08);
|
||||
spA2 = CAM_DEG_TO_BINANG(keep4->unk_08);
|
||||
spA0 = BINANG_SUB(BINANG_ROT180(playerPosRot->rot.y), spA8.yaw) > 0
|
||||
? BINANG_ROT180(playerPosRot->rot.y) + DEGF_TO_BINANG(keep4->unk_0C)
|
||||
: BINANG_ROT180(playerPosRot->rot.y) - DEGF_TO_BINANG(keep4->unk_0C);
|
||||
? BINANG_ROT180(playerPosRot->rot.y) + CAM_DEG_TO_BINANG(keep4->unk_0C)
|
||||
: BINANG_ROT180(playerPosRot->rot.y) - CAM_DEG_TO_BINANG(keep4->unk_0C);
|
||||
} else if (keep4->unk_1C & 4) {
|
||||
spA2 = DEGF_TO_BINANG(keep4->unk_08);
|
||||
spA0 = DEGF_TO_BINANG(keep4->unk_0C);
|
||||
spA2 = CAM_DEG_TO_BINANG(keep4->unk_08);
|
||||
spA0 = CAM_DEG_TO_BINANG(keep4->unk_0C);
|
||||
} else if ((keep4->unk_1C & 8) && camera->target != NULL) {
|
||||
PosRot sp60;
|
||||
|
||||
Actor_GetWorldPosShapeRot(&sp60, camera->target);
|
||||
spA2 = DEGF_TO_BINANG(keep4->unk_08) - sp60.rot.x;
|
||||
spA2 = CAM_DEG_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)
|
||||
: BINANG_ROT180(sp60.rot.y) - DEGF_TO_BINANG(keep4->unk_0C);
|
||||
? BINANG_ROT180(sp60.rot.y) + CAM_DEG_TO_BINANG(keep4->unk_0C)
|
||||
: BINANG_ROT180(sp60.rot.y) - CAM_DEG_TO_BINANG(keep4->unk_0C);
|
||||
spCC[1] = camera->target;
|
||||
sp9C++;
|
||||
} else if ((keep4->unk_1C & 0x80) && camera->target != NULL) {
|
||||
PosRot sp4C;
|
||||
|
||||
Actor_GetWorld(&sp4C, camera->target);
|
||||
spA2 = DEGF_TO_BINANG(keep4->unk_08);
|
||||
spA2 = CAM_DEG_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)
|
||||
: sp9E - DEGF_TO_BINANG(keep4->unk_0C);
|
||||
spA0 = (BINANG_SUB(sp9E, spA8.yaw) > 0) ? sp9E + CAM_DEG_TO_BINANG(keep4->unk_0C)
|
||||
: sp9E - CAM_DEG_TO_BINANG(keep4->unk_0C);
|
||||
spCC[1] = camera->target;
|
||||
sp9C++;
|
||||
} else if (keep4->unk_1C & 0x40) {
|
||||
spA2 = DEGF_TO_BINANG(keep4->unk_08);
|
||||
spA2 = CAM_DEG_TO_BINANG(keep4->unk_08);
|
||||
spA0 = spA8.yaw;
|
||||
} else {
|
||||
spA2 = spA8.pitch;
|
||||
|
@ -4458,9 +4458,9 @@ s32 Camera_Data4(Camera* camera) {
|
|||
|
||||
atOffset.r = eyeAtOffset.r;
|
||||
atOffset.yaw =
|
||||
(initParams->jfifId & 1) ? (DEGF_TO_BINANG(camera->data2) + initParams->eyePosRot.rot.y) : eyeAtOffset.yaw;
|
||||
(initParams->jfifId & 1) ? (CAM_DEG_TO_BINANG(camera->data2) + initParams->eyePosRot.rot.y) : eyeAtOffset.yaw;
|
||||
atOffset.pitch =
|
||||
(initParams->jfifId & 2) ? (DEGF_TO_BINANG(camera->data3) + initParams->eyePosRot.rot.x) : eyeAtOffset.pitch;
|
||||
(initParams->jfifId & 2) ? (CAM_DEG_TO_BINANG(camera->data3) + initParams->eyePosRot.rot.x) : eyeAtOffset.pitch;
|
||||
|
||||
Camera_Vec3fVecSphGeoAdd(at, eye, &atOffset);
|
||||
|
||||
|
@ -4503,7 +4503,7 @@ s32 Camera_Unique1(Camera* camera) {
|
|||
uniq1->yOffset = NEXTPCT * playerHeight * yNormal;
|
||||
uniq1->distMin = NEXTPCT * playerHeight * yNormal;
|
||||
uniq1->distMax = NEXTPCT * playerHeight * yNormal;
|
||||
uniq1->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
|
||||
uniq1->pitchTarget = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
uniq1->fovTarget = NEXTSETTING;
|
||||
uniq1->atLERPScaleMax = NEXTPCT;
|
||||
uniq1->interfaceFlags = NEXTSETTING;
|
||||
|
@ -5115,8 +5115,8 @@ s32 Camera_Unique9(Camera* camera) {
|
|||
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);
|
||||
scratchSph.pitch = CAM_DEG_TO_BINANG(anim->curKeyFrame->atTargetInit.x);
|
||||
scratchSph.yaw = CAM_DEG_TO_BINANG(anim->curKeyFrame->atTargetInit.y);
|
||||
scratchSph.r = anim->curKeyFrame->atTargetInit.z;
|
||||
} else {
|
||||
OLib_Vec3fToVecSphGeo(&scratchSph, &anim->curKeyFrame->atTargetInit);
|
||||
|
@ -5153,8 +5153,8 @@ s32 Camera_Unique9(Camera* camera) {
|
|||
}
|
||||
|
||||
if (atInitFlags & (s16)0x8080) {
|
||||
scratchSph.pitch = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.x);
|
||||
scratchSph.yaw = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.y);
|
||||
scratchSph.pitch = CAM_DEG_TO_BINANG(anim->curKeyFrame->atTargetInit.x);
|
||||
scratchSph.yaw = CAM_DEG_TO_BINANG(anim->curKeyFrame->atTargetInit.y);
|
||||
scratchSph.r = anim->curKeyFrame->atTargetInit.z;
|
||||
} else {
|
||||
OLib_Vec3fToVecSphGeo(&scratchSph, &anim->curKeyFrame->atTargetInit);
|
||||
|
@ -5204,8 +5204,8 @@ s32 Camera_Unique9(Camera* camera) {
|
|||
}
|
||||
|
||||
if (eyeInitFlags & (s16)0x8080) {
|
||||
scratchSph.pitch = DEGF_TO_BINANG(anim->curKeyFrame->eyeTargetInit.x);
|
||||
scratchSph.yaw = DEGF_TO_BINANG(anim->curKeyFrame->eyeTargetInit.y);
|
||||
scratchSph.pitch = CAM_DEG_TO_BINANG(anim->curKeyFrame->eyeTargetInit.x);
|
||||
scratchSph.yaw = CAM_DEG_TO_BINANG(anim->curKeyFrame->eyeTargetInit.y);
|
||||
scratchSph.r = anim->curKeyFrame->eyeTargetInit.z;
|
||||
} else {
|
||||
OLib_Vec3fToVecSphGeo(&scratchSph, &anim->curKeyFrame->eyeTargetInit);
|
||||
|
@ -5245,8 +5245,8 @@ s32 Camera_Unique9(Camera* camera) {
|
|||
}
|
||||
|
||||
if (eyeInitFlags & (s16)0x8080) {
|
||||
scratchSph.pitch = DEGF_TO_BINANG(anim->curKeyFrame->eyeTargetInit.x);
|
||||
scratchSph.yaw = DEGF_TO_BINANG(anim->curKeyFrame->eyeTargetInit.y);
|
||||
scratchSph.pitch = CAM_DEG_TO_BINANG(anim->curKeyFrame->eyeTargetInit.x);
|
||||
scratchSph.yaw = CAM_DEG_TO_BINANG(anim->curKeyFrame->eyeTargetInit.y);
|
||||
scratchSph.r = anim->curKeyFrame->eyeTargetInit.z;
|
||||
} else {
|
||||
OLib_Vec3fToVecSphGeo(&scratchSph, &anim->curKeyFrame->eyeTargetInit);
|
||||
|
@ -5275,7 +5275,7 @@ s32 Camera_Unique9(Camera* camera) {
|
|||
anim->rollTarget = camera->roll;
|
||||
} else {
|
||||
anim->fovTarget = anim->curKeyFrame->fovTargetInit;
|
||||
anim->rollTarget = DEGF_TO_BINANG(anim->curKeyFrame->rollTargetInit);
|
||||
anim->rollTarget = CAM_DEG_TO_BINANG(anim->curKeyFrame->rollTargetInit);
|
||||
}
|
||||
|
||||
action = anim->curKeyFrame->actionFlags & 0x1F;
|
||||
|
@ -5391,7 +5391,7 @@ s32 Camera_Unique9(Camera* camera) {
|
|||
camera->at.y += camera->playerPosDelta.y * anim->curKeyFrame->lerpStepScale;
|
||||
camera->at.z = Camera_LERPCeilF(anim->atTarget.z, camera->at.z, anim->curKeyFrame->lerpStepScale, 1.0f);
|
||||
OLib_Vec3fDiffToVecSphGeo(&scratchSph, at, eyeNext);
|
||||
scratchSph.yaw += DEGF_TO_BINANG(anim->curKeyFrame->eyeTargetInit.y);
|
||||
scratchSph.yaw += CAM_DEG_TO_BINANG(anim->curKeyFrame->eyeTargetInit.y);
|
||||
|
||||
// 3A98 ~ 82.40 degrees
|
||||
if (scratchSph.pitch >= 0x3A99) {
|
||||
|
@ -6402,7 +6402,7 @@ s32 Camera_Special5(Camera* camera) {
|
|||
spec5->eyeDist = NEXTSETTING;
|
||||
spec5->minDistForRot = NEXTSETTING;
|
||||
spec5->timerInit = NEXTSETTING;
|
||||
spec5->pitch = DEGF_TO_BINANG(NEXTSETTING);
|
||||
spec5->pitch = CAM_DEG_TO_BINANG(NEXTSETTING);
|
||||
spec5->fovTarget = NEXTSETTING;
|
||||
spec5->atMaxLERPScale = NEXTPCT;
|
||||
spec5->interfaceFlags = NEXTSETTING;
|
||||
|
@ -7293,8 +7293,8 @@ void Camera_UpdateDistortion(Camera* camera) {
|
|||
return;
|
||||
}
|
||||
|
||||
depthPhase += DEGF_TO_BINANG(depthPhaseStep);
|
||||
screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep);
|
||||
depthPhase += CAM_DEG_TO_BINANG(depthPhaseStep);
|
||||
screenPlanePhase += CAM_DEG_TO_BINANG(screenPlanePhaseStep);
|
||||
|
||||
View_SetDistortionOrientation(&camera->globalCtx->view, Math_CosS(depthPhase) * 0.0f,
|
||||
Math_SinS(depthPhase) * 0.0f, Math_SinS(screenPlanePhase) * 0.0f);
|
||||
|
@ -7498,7 +7498,7 @@ Vec3s Camera_Update(Camera* camera) {
|
|||
OLib_Vec3fDiffToVecSphGeo(&eyeAtAngle, &viewEye, &viewAt);
|
||||
Camera_CalcUpFromPitchYawRoll(&viewUp, eyeAtAngle.pitch + quake.rotZ, eyeAtAngle.yaw + quake.unk_1A,
|
||||
camera->roll);
|
||||
viewFov = camera->fov + BINANG_TO_DEGF(quake.zoom);
|
||||
viewFov = camera->fov + CAM_BINANG_TO_DEG(quake.zoom);
|
||||
} else {
|
||||
viewAt = camera->at;
|
||||
viewEye = camera->eye;
|
||||
|
@ -7537,9 +7537,9 @@ Vec3s Camera_Update(Camera* camera) {
|
|||
|
||||
if (PREG(81)) {
|
||||
osSyncPrintf("dir (%d) %d(%f) %d(%f) 0(0) \n", sUpdateCameraDirection, camera->inputDir.x,
|
||||
BINANG_TO_DEGF(camera->inputDir.x), camera->inputDir.y, BINANG_TO_DEGF(camera->inputDir.y));
|
||||
CAM_BINANG_TO_DEG(camera->inputDir.x), camera->inputDir.y, CAM_BINANG_TO_DEG(camera->inputDir.y));
|
||||
osSyncPrintf("real (%d) %d(%f) %d(%f) 0(0) \n", sUpdateCameraDirection, camera->camDir.x,
|
||||
BINANG_TO_DEGF(camera->camDir.x), camera->camDir.y, BINANG_TO_DEGF(camera->camDir.y));
|
||||
CAM_BINANG_TO_DEG(camera->camDir.x), camera->camDir.y, CAM_BINANG_TO_DEG(camera->camDir.y));
|
||||
}
|
||||
|
||||
if (camera->timer != -1 && CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_DRIGHT)) {
|
||||
|
@ -7550,7 +7550,8 @@ Vec3s Camera_Update(Camera* camera) {
|
|||
osSyncPrintf("camera: out (%f %f %f) (%f %f %f)\n", camera->at.x, camera->at.y, camera->at.z, camera->eye.x,
|
||||
camera->eye.y, camera->eye.z);
|
||||
osSyncPrintf("camera: dir (%f %d(%f) %d(%f)) (%f)\n", eyeAtAngle.r, eyeAtAngle.pitch,
|
||||
BINANG_TO_DEGF(eyeAtAngle.pitch), eyeAtAngle.yaw, BINANG_TO_DEGF(eyeAtAngle.yaw), camera->fov);
|
||||
CAM_BINANG_TO_DEG(eyeAtAngle.pitch), eyeAtAngle.yaw, CAM_BINANG_TO_DEG(eyeAtAngle.yaw),
|
||||
camera->fov);
|
||||
if (camera->player != NULL) {
|
||||
osSyncPrintf("camera: foot(%f %f %f) dist (%f)\n", curPlayerPosRot.pos.x, curPlayerPosRot.pos.y,
|
||||
curPlayerPosRot.pos.z, camera->dist);
|
||||
|
@ -7933,7 +7934,7 @@ s32 Camera_SetParam(Camera* camera, s32 param, void* value) {
|
|||
camera->up = *(Vec3f*)value;
|
||||
break;
|
||||
case 0x40:
|
||||
camera->roll = DEGF_TO_BINANG(*(f32*)value);
|
||||
camera->roll = CAM_DEG_TO_BINANG(*(f32*)value);
|
||||
break;
|
||||
case 0x20:
|
||||
camera->fov = *(f32*)value;
|
||||
|
|
|
@ -117,14 +117,14 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
|
|||
if ((dist == 0.0f) && (vec->y == 0.0f)) {
|
||||
sph.pitch = 0;
|
||||
} else {
|
||||
sph.pitch = DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(dist, vec->y)));
|
||||
sph.pitch = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(dist, vec->y)));
|
||||
}
|
||||
|
||||
sph.r = sqrtf(SQ(vec->y) + distSquared);
|
||||
if ((vec->x == 0.0f) && (vec->z == 0.0f)) {
|
||||
sph.yaw = 0;
|
||||
} else {
|
||||
sph.yaw = DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(vec->x, vec->z)));
|
||||
sph.yaw = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(vec->x, vec->z)));
|
||||
}
|
||||
|
||||
*dest = sph;
|
||||
|
@ -196,8 +196,8 @@ Vec3f* OLib_Vec3fDiffDegF(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
|||
|
||||
OLib_Vec3fDiffRad(&anglesRad, a, b);
|
||||
|
||||
anglesDegrees.x = RADF_TO_DEGF(anglesRad.x);
|
||||
anglesDegrees.y = RADF_TO_DEGF(anglesRad.y);
|
||||
anglesDegrees.x = RAD_TO_DEG(anglesRad.x);
|
||||
anglesDegrees.y = RAD_TO_DEG(anglesRad.y);
|
||||
anglesDegrees.z = 0.0f;
|
||||
|
||||
*dest = anglesDegrees;
|
||||
|
@ -214,8 +214,8 @@ Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b) {
|
|||
|
||||
OLib_Vec3fDiffRad(&anglesRad, a, b);
|
||||
|
||||
anglesBinAng.x = DEGF_TO_BINANG(RADF_TO_DEGF(anglesRad.x));
|
||||
anglesBinAng.y = DEGF_TO_BINANG(RADF_TO_DEGF(anglesRad.y));
|
||||
anglesBinAng.x = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.x));
|
||||
anglesBinAng.y = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.y));
|
||||
anglesBinAng.z = 0.0f;
|
||||
|
||||
*dest = anglesBinAng;
|
||||
|
|
|
@ -22,7 +22,7 @@ void OnePointCutscene_AddVecSphToVec3f(Vec3f* dst, Vec3f* src, VecSph* vecSph) {
|
|||
}
|
||||
|
||||
s16 OnePointCutscene_Vec3fYaw(Vec3f* vec1, Vec3f* vec2) {
|
||||
return DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(vec2->x - vec1->x, vec2->z - vec1->z)));
|
||||
return CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(vec2->x - vec1->x, vec2->z - vec1->z)));
|
||||
}
|
||||
|
||||
void OnePointCutscene_Vec3sToVec3f(Vec3f* src, Vec3s* dst) {
|
||||
|
@ -95,7 +95,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act
|
|||
D_80120964[0].eyeTargetInit = globalCtx->view.eye;
|
||||
D_80120964[0].fovTargetInit = globalCtx->view.fovy;
|
||||
OLib_Vec3fDiffToVecSphGeo(&spD0, &mainCam->at, &mainCam->eye);
|
||||
D_80120964[1].eyeTargetInit.y = BINANG_TO_DEGF(spD0.yaw);
|
||||
D_80120964[1].eyeTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
|
||||
D_80120964[1].timerInit = timer - 1;
|
||||
|
||||
csInfo->keyFrames = D_80120964;
|
||||
|
@ -310,7 +310,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act
|
|||
case 2210:
|
||||
OLib_Vec3fDiffToVecSphGeo(&spD0, &player->actor.world.pos, &actor->world.pos);
|
||||
D_801213B4[0].eyeTargetInit.y = D_801213B4[1].eyeTargetInit.y = D_801213B4[2].eyeTargetInit.y =
|
||||
D_801213B4[2].atTargetInit.y = BINANG_TO_DEGF(spD0.yaw);
|
||||
D_801213B4[2].atTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
|
||||
if (Rand_ZeroOne() < 0.0f) {
|
||||
D_801213B4[3].eyeTargetInit.x = -D_801213B4[3].eyeTargetInit.x;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw) {
|
|||
dx = pointPos->x - actor->world.pos.x;
|
||||
dz = pointPos->z - actor->world.pos.z;
|
||||
|
||||
*yaw = RADF_TO_BINANG(Math_FAtan2F(dx, dz));
|
||||
*yaw = RAD_TO_BINANG(Math_FAtan2F(dx, dz));
|
||||
|
||||
return SQ(dx) + SQ(dz);
|
||||
}
|
||||
|
|
|
@ -1014,14 +1014,14 @@ void func_8008F87C(GlobalContext* globalCtx, Player* this, SkelAnime* skelAnime,
|
|||
|
||||
sp50 = Math_FAtan2F(sp58, sp60);
|
||||
|
||||
temp1 = RADF_TO_BINANG(M_PI - (Math_FAtan2F(sp5C, sp58) + ((M_PI / 2) - sp50)));
|
||||
temp1 = RAD_TO_BINANG(M_PI - (Math_FAtan2F(sp5C, sp58) + ((M_PI / 2) - sp50)));
|
||||
temp1 = temp1 - skelAnime->jointTable[shinLimbIndex].z;
|
||||
|
||||
if ((s16)(ABS(skelAnime->jointTable[shinLimbIndex].x) + ABS(skelAnime->jointTable[shinLimbIndex].y)) < 0) {
|
||||
temp1 += 0x8000;
|
||||
}
|
||||
|
||||
temp2 = RADF_TO_BINANG(sp50 - sp54);
|
||||
temp2 = RAD_TO_BINANG(sp50 - sp54);
|
||||
rot->z -= temp2;
|
||||
|
||||
skelAnime->jointTable[thighLimbIndex].z = skelAnime->jointTable[thighLimbIndex].z - temp2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue