fix: disable Idle camera re-center no longer stuck on level geometry (#3094)

This commit is contained in:
Adam Bird 2023-08-06 12:05:34 -04:00 committed by GitHub
parent f68a4e930d
commit f5ab1a9b5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1678,12 +1678,13 @@ s32 Camera_Normal1(Camera* camera) {
Camera_ClampDist(camera, eyeAdjustment.r, norm1->distMin, norm1->distMax, anim->unk_28); Camera_ClampDist(camera, eyeAdjustment.r, norm1->distMin, norm1->distMax, anim->unk_28);
if (anim->startSwingTimer <= 0) { if (anim->startSwingTimer <= 0) {
// idle camera re-center
if (CVarGetInteger("gA11yDisableIdleCam", 0)) return; if (CVarGetInteger("gA11yDisableIdleCam", 0)) return;
eyeAdjustment.pitch = atEyeNextGeo.pitch; eyeAdjustment.pitch = atEyeNextGeo.pitch;
eyeAdjustment.yaw = eyeAdjustment.yaw =
Camera_LERPCeilS(anim->swingYawTarget, atEyeNextGeo.yaw, 1.0f / camera->yawUpdateRateInv, 0xA); Camera_LERPCeilS(anim->swingYawTarget, atEyeNextGeo.yaw, 1.0f / camera->yawUpdateRateInv, 0xA);
} else if (anim->swing.unk_18 != 0) { } else if (anim->swing.unk_18 != 0) {
if (CVarGetInteger("gA11yDisableIdleCam", 0)) return; // camera adjustments when obstructed/pushed by scene geometry
eyeAdjustment.yaw = eyeAdjustment.yaw =
Camera_LERPCeilS(anim->swing.unk_16, atEyeNextGeo.yaw, 1.0f / camera->yawUpdateRateInv, 0xA); Camera_LERPCeilS(anim->swing.unk_16, atEyeNextGeo.yaw, 1.0f / camera->yawUpdateRateInv, 0xA);
eyeAdjustment.pitch = eyeAdjustment.pitch =
@ -1708,19 +1709,19 @@ s32 Camera_Normal1(Camera* camera) {
if ((camera->status == CAM_STAT_ACTIVE) && (!(norm1->interfaceFlags & 0x10))) { if ((camera->status == CAM_STAT_ACTIVE) && (!(norm1->interfaceFlags & 0x10))) {
anim->swingYawTarget = BINANG_ROT180(camera->playerPosRot.rot.y); anim->swingYawTarget = BINANG_ROT180(camera->playerPosRot.rot.y);
if (!CVarGetInteger("gFixCameraSwing", 0)) { if (!CVarGetInteger("gFixCameraSwing", 0)) {
if (anim->startSwingTimer > 0) { if (anim->startSwingTimer > 0) {
func_80046E20(camera, &eyeAdjustment, norm1->distMin, norm1->unk_0C, &sp98, &anim->swing); func_80046E20(camera, &eyeAdjustment, norm1->distMin, norm1->unk_0C, &sp98, &anim->swing);
} else {
sp88 = *eyeNext;
anim->swing.swingUpdateRate = camera->yawUpdateRateInv = norm1->unk_0C * 2.0f;
if (Camera_BGCheck(camera, at, &sp88)) {
anim->swingYawTarget = atEyeNextGeo.yaw;
anim->startSwingTimer = -1;
} else { } else {
*eye = *eyeNext; sp88 = *eyeNext;
anim->swing.swingUpdateRate = camera->yawUpdateRateInv = norm1->unk_0C * 2.0f;
if (Camera_BGCheck(camera, at, &sp88)) {
anim->swingYawTarget = atEyeNextGeo.yaw;
anim->startSwingTimer = -1;
} else {
*eye = *eyeNext;
}
anim->swing.unk_18 = 0;
} }
anim->swing.unk_18 = 0;
}
} else { } else {
if (anim->startSwingTimer <= 0) { if (anim->startSwingTimer <= 0) {
anim->swing.swingUpdateRate = camera->yawUpdateRateInv = norm1->unk_0C * 2.0f; anim->swing.swingUpdateRate = camera->yawUpdateRateInv = norm1->unk_0C * 2.0f;