mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-29 03:34:07 +00:00
Some OREG
docs (camera data regs) (#1405)
* very wip oreg docs * more * more * more * more useful comment
This commit is contained in:
parent
e4664b4750
commit
bea53e1cc3
3 changed files with 181 additions and 138 deletions
|
@ -58,15 +58,26 @@
|
|||
#define R_FB_FILTER_ENV_COLOR(c) SREG(85 + (c))
|
||||
#define R_ENABLE_FB_FILTER SREG(88)
|
||||
#define R_PAUSE_MENU_MODE SREG(94)
|
||||
#define R_CAM_XZ_OFFSET_UPDATE_RATE OREG(2)
|
||||
#define R_CAM_Y_OFFSET_UPDATE_RATE OREG(3)
|
||||
#define R_CAM_FOV_UPDATE_RATE OREG(4)
|
||||
#define R_CAM_MAX_PITCH OREG(5)
|
||||
#define R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV OREG(7)
|
||||
#define R_CAM_R_UPDATE_RATE_INV OREG(6)
|
||||
#define R_CAM_PITCH_UPDATE_RATE_INV OREG(7)
|
||||
#define R_CAM_SLOPE_Y_ADJ_AMOUNT OREG(9)
|
||||
#define R_CAM_PITCH_FLOOR_CHECK_NEAR_DIST_FAC OREG(17)
|
||||
#define R_CAM_PITCH_FLOOR_CHECK_FAR_DIST_FAC OREG(18)
|
||||
#define R_CAM_PITCH_FLOOR_CHECK_OFFSET_Y_FAC OREG(19)
|
||||
#define R_CAM_PITCH_FLOOR_CHECK_NEAR_WEIGHT OREG(20)
|
||||
#define R_CAM_DEFAULT_ANIM_TIME OREG(23)
|
||||
#define R_CAM_UPDATE_RATE_STEP_SCALE_XZ OREG(25) // also used as a step scale for other data
|
||||
#define R_CAM_UPDATE_RATE_STEP_SCALE_Y OREG(26) // also used as a step scale for other data
|
||||
#define R_CAM_JUMP1_EYE_Y_STEP_SCALE OREG(31)
|
||||
#define R_CAM_MIN_PITCH_1 OREG(34)
|
||||
#define R_CAM_MIN_PITCH_2 OREG(35)
|
||||
#define R_CAM_BATTLE1_ROLL_TARGET_BASE OREG(36)
|
||||
#define R_CAM_BATTLE1_ROLL_STEP_SCALE OREG(37)
|
||||
#define R_CAM_BATTLE1_XYZ_OFFSET_UPDATE_RATE_TARGET OREG(40)
|
||||
#define R_CAM_AT_LERP_STEP_SCALE_MIN OREG(41)
|
||||
#define R_CAM_AT_LERP_STEP_SCALE_FAC OREG(42)
|
||||
#define R_CAM_YOFFSET_NORM OREG(46)
|
||||
|
|
|
@ -156,11 +156,11 @@ void Camera_LERPCeilVec3f(Vec3f* target, Vec3f* cur, f32 yStepScale, f32 xzStepS
|
|||
|
||||
void func_80043ABC(Camera* camera) {
|
||||
camera->yawUpdateRateInv = 100.0f;
|
||||
camera->pitchUpdateRateInv = R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV;
|
||||
camera->rUpdateRateInv = OREG(6);
|
||||
camera->xzOffsetUpdateRate = CAM_DATA_SCALED(OREG(2));
|
||||
camera->yOffsetUpdateRate = CAM_DATA_SCALED(OREG(3));
|
||||
camera->fovUpdateRate = CAM_DATA_SCALED(OREG(4));
|
||||
camera->pitchUpdateRateInv = R_CAM_PITCH_UPDATE_RATE_INV;
|
||||
camera->rUpdateRateInv = R_CAM_R_UPDATE_RATE_INV;
|
||||
camera->xzOffsetUpdateRate = CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE);
|
||||
camera->yOffsetUpdateRate = CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE);
|
||||
camera->fovUpdateRate = CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE);
|
||||
}
|
||||
|
||||
void func_80043B60(Camera* camera) {
|
||||
|
@ -928,7 +928,8 @@ s32 Camera_CalcAtDefault(Camera* camera, VecGeo* eyeAtDir, f32 extraYOffset, s16
|
|||
|
||||
if (calcSlope) {
|
||||
posOffsetTarget.y -= OLib_ClampMaxDist(
|
||||
Camera_CalcSlopeYAdj(&camera->floorNorm, playerPosRot->rot.y, eyeAtDir->yaw, OREG(9)), yOffset);
|
||||
Camera_CalcSlopeYAdj(&camera->floorNorm, playerPosRot->rot.y, eyeAtDir->yaw, R_CAM_SLOPE_Y_ADJ_AMOUNT),
|
||||
yOffset);
|
||||
}
|
||||
|
||||
Camera_LERPCeilVec3f(&posOffsetTarget, &camera->posOffset, camera->yOffsetUpdateRate, camera->xzOffsetUpdateRate,
|
||||
|
@ -957,7 +958,8 @@ s32 func_800458D4(Camera* camera, VecGeo* eyeAtDir, f32 arg2, f32* arg3, s16 arg
|
|||
posOffsetTarget.z = 0.0f;
|
||||
|
||||
if (arg4) {
|
||||
posOffsetTarget.y -= Camera_CalcSlopeYAdj(&camera->floorNorm, playerPosRot->rot.y, eyeAtDir->yaw, OREG(9));
|
||||
posOffsetTarget.y -=
|
||||
Camera_CalcSlopeYAdj(&camera->floorNorm, playerPosRot->rot.y, eyeAtDir->yaw, R_CAM_SLOPE_Y_ADJ_AMOUNT);
|
||||
}
|
||||
|
||||
deltaY = playerPosRot->pos.y - *arg3;
|
||||
|
@ -1005,7 +1007,7 @@ s32 func_80045B08(Camera* camera, VecGeo* eyeAtDir, f32 yExtra, s16 arg3) {
|
|||
phi_f2 = -Math_CosS(playerPosRot->rot.y - eyeAtDir->yaw);
|
||||
}
|
||||
|
||||
posOffsetTarget.y -= temp_ret * phi_f2 * OREG(9);
|
||||
posOffsetTarget.y -= temp_ret * phi_f2 * R_CAM_SLOPE_Y_ADJ_AMOUNT;
|
||||
Camera_LERPCeilVec3f(&posOffsetTarget, &camera->posOffset, camera->yOffsetUpdateRate, camera->xzOffsetUpdateRate,
|
||||
0.1f);
|
||||
|
||||
|
@ -1038,7 +1040,8 @@ s32 Camera_CalcAtForParallel(Camera* camera, VecGeo* arg1, f32 yOffset, f32* arg
|
|||
posOffsetTarget.z = 0.0f;
|
||||
|
||||
if (PREG(76) && arg4) {
|
||||
posOffsetTarget.y -= Camera_CalcSlopeYAdj(&camera->floorNorm, playerPosRot->rot.y, arg1->yaw, OREG(9));
|
||||
posOffsetTarget.y -=
|
||||
Camera_CalcSlopeYAdj(&camera->floorNorm, playerPosRot->rot.y, arg1->yaw, R_CAM_SLOPE_Y_ADJ_AMOUNT);
|
||||
}
|
||||
|
||||
if (camera->playerGroundY == camera->playerPosRot.pos.y || camera->player->actor.gravity > -0.1f ||
|
||||
|
@ -1110,7 +1113,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecGeo* eyeAtDir, Vec3f* targetPos, f
|
|||
tmpPos0.y = playerHeight + yOffset;
|
||||
tmpPos0.z = 0.0f;
|
||||
if (PREG(76) && (flags & FLG_ADJSLOPE)) {
|
||||
tmpPos0.y -= Camera_CalcSlopeYAdj(floorNorm, playerPosRot->rot.y, eyeAtDir->yaw, OREG(9));
|
||||
tmpPos0.y -= Camera_CalcSlopeYAdj(floorNorm, playerPosRot->rot.y, eyeAtDir->yaw, R_CAM_SLOPE_Y_ADJ_AMOUNT);
|
||||
}
|
||||
|
||||
// tmpPos1 is player's head
|
||||
|
@ -1219,8 +1222,8 @@ s32 Camera_CalcAtForHorse(Camera* camera, VecGeo* eyeAtDir, f32 yOffset, f32* yP
|
|||
posOffsetTarget.z = 0.0f;
|
||||
|
||||
if (calcSlope != 0) {
|
||||
posOffsetTarget.y -=
|
||||
Camera_CalcSlopeYAdj(&camera->floorNorm, camera->playerPosRot.rot.y, eyeAtDir->yaw, OREG(9));
|
||||
posOffsetTarget.y -= Camera_CalcSlopeYAdj(&camera->floorNorm, camera->playerPosRot.rot.y, eyeAtDir->yaw,
|
||||
R_CAM_SLOPE_Y_ADJ_AMOUNT);
|
||||
}
|
||||
|
||||
Camera_LERPCeilVec3f(&posOffsetTarget, &camera->posOffset, camera->yOffsetUpdateRate, camera->xzOffsetUpdateRate,
|
||||
|
@ -1240,17 +1243,17 @@ f32 Camera_LERPClampDist(Camera* camera, f32 dist, f32 min, f32 max) {
|
|||
|
||||
if (dist < min) {
|
||||
distTarget = min;
|
||||
rUpdateRateInvTarget = OREG(6);
|
||||
rUpdateRateInvTarget = R_CAM_R_UPDATE_RATE_INV;
|
||||
} else if (dist > max) {
|
||||
distTarget = max;
|
||||
rUpdateRateInvTarget = OREG(6);
|
||||
rUpdateRateInvTarget = R_CAM_R_UPDATE_RATE_INV;
|
||||
} else {
|
||||
distTarget = dist;
|
||||
rUpdateRateInvTarget = 1.0f;
|
||||
}
|
||||
|
||||
camera->rUpdateRateInv =
|
||||
Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->rUpdateRateInv = Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
return Camera_LERPCeilF(distTarget, camera->dist, 1.0f / camera->rUpdateRateInv, 0.2f);
|
||||
}
|
||||
|
||||
|
@ -1261,19 +1264,19 @@ f32 Camera_ClampDist(Camera* camera, f32 dist, f32 minDist, f32 maxDist, s16 tim
|
|||
if (dist < minDist) {
|
||||
distTarget = minDist;
|
||||
|
||||
rUpdateRateInvTarget = timer != 0 ? OREG(6) * 0.5f : OREG(6);
|
||||
rUpdateRateInvTarget = timer != 0 ? R_CAM_R_UPDATE_RATE_INV * 0.5f : R_CAM_R_UPDATE_RATE_INV;
|
||||
} else if (maxDist < dist) {
|
||||
distTarget = maxDist;
|
||||
|
||||
rUpdateRateInvTarget = timer != 0 ? OREG(6) * 0.5f : OREG(6);
|
||||
rUpdateRateInvTarget = timer != 0 ? R_CAM_R_UPDATE_RATE_INV * 0.5f : R_CAM_R_UPDATE_RATE_INV;
|
||||
} else {
|
||||
distTarget = dist;
|
||||
|
||||
rUpdateRateInvTarget = timer != 0 ? OREG(6) : 1.0f;
|
||||
rUpdateRateInvTarget = timer != 0 ? R_CAM_R_UPDATE_RATE_INV : 1.0f;
|
||||
}
|
||||
|
||||
camera->rUpdateRateInv =
|
||||
Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->rUpdateRateInv = Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
return Camera_LERPCeilF(distTarget, camera->dist, 1.0f / camera->rUpdateRateInv, 0.2f);
|
||||
}
|
||||
|
||||
|
@ -1519,9 +1522,9 @@ s32 Camera_Normal1(Camera* camera) {
|
|||
rwData->startSwingTimer--;
|
||||
}
|
||||
|
||||
spA0 = camera->speedRatio * CAM_DATA_SCALED(OREG(25));
|
||||
sp9C = camera->speedRatio * CAM_DATA_SCALED(OREG(26));
|
||||
sp98 = rwData->swing.unk_18 != 0 ? CAM_DATA_SCALED(OREG(25)) : spA0;
|
||||
spA0 = camera->speedRatio * CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ);
|
||||
sp9C = camera->speedRatio * CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y);
|
||||
sp98 = rwData->swing.unk_18 != 0 ? CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) : spA0;
|
||||
|
||||
sp94 = (camera->xzSpeed - rwData->unk_20) * (0.333333f);
|
||||
if (sp94 > 1.0f) {
|
||||
|
@ -1538,7 +1541,7 @@ s32 Camera_Normal1(Camera* camera) {
|
|||
Camera_LERPCeilF(rwData->swing.swingUpdateRate + (f32)(rwData->swing.swingUpdateRateTimer * 2),
|
||||
camera->yawUpdateRateInv, sp98, rate);
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF((f32)R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV + (f32)(rwData->swing.swingUpdateRateTimer * 2),
|
||||
Camera_LERPCeilF((f32)R_CAM_PITCH_UPDATE_RATE_INV + (f32)(rwData->swing.swingUpdateRateTimer * 2),
|
||||
camera->pitchUpdateRateInv, sp9C, rate);
|
||||
rwData->swing.swingUpdateRateTimer--;
|
||||
} else {
|
||||
|
@ -1546,15 +1549,16 @@ s32 Camera_Normal1(Camera* camera) {
|
|||
((OREG(49) * 0.01f) * rwData->swing.swingUpdateRate * sp94),
|
||||
camera->yawUpdateRateInv, sp98, rate);
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF(R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, sp9C, rate);
|
||||
Camera_LERPCeilF(R_CAM_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, sp9C, rate);
|
||||
}
|
||||
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF(R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, sp9C, rate);
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(2)), camera->xzOffsetUpdateRate, spA0, rate);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate, sp9C, rate);
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->yOffsetUpdateRate, camera->speedRatio * 0.05f, rate);
|
||||
camera->pitchUpdateRateInv = Camera_LERPCeilF(R_CAM_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, sp9C, rate);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE), camera->xzOffsetUpdateRate, spA0, rate);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate, sp9C, rate);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->yOffsetUpdateRate,
|
||||
camera->speedRatio * 0.05f, rate);
|
||||
|
||||
if (roData->interfaceFlags & 1) {
|
||||
t = Camera_GetPitchAdjFromFloorHeightDiffs(camera, atEyeGeo.yaw - 0x7FFF, false);
|
||||
|
@ -1752,17 +1756,18 @@ s32 Camera_Normal2(Camera* camera) {
|
|||
OLib_Vec3fDiffToVecGeo(&atToEyeNextDir, at, eyeNext);
|
||||
|
||||
camera->speedRatio *= 0.5f;
|
||||
spA4 = CAM_DATA_SCALED(OREG(25)) * camera->speedRatio;
|
||||
spA0 = CAM_DATA_SCALED(OREG(26)) * camera->speedRatio;
|
||||
spA4 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio;
|
||||
spA0 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y) * camera->speedRatio;
|
||||
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->unk_0C, camera->yawUpdateRateInv * camera->speedRatio,
|
||||
CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF(R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, spA0, 0.1f);
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(2)), camera->xzOffsetUpdateRate, spA4, 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate, spA0, 0.1f);
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->yOffsetUpdateRate, camera->speedRatio * 0.05f, 0.1f);
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
camera->pitchUpdateRateInv = Camera_LERPCeilF(R_CAM_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, spA0, 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE), camera->xzOffsetUpdateRate, spA4, 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate, spA0, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->yOffsetUpdateRate,
|
||||
camera->speedRatio * 0.05f, 0.1f);
|
||||
|
||||
if (!(roData->interfaceFlags & 0x80)) {
|
||||
Camera_CalcAtDefault(camera, &atToEyeNextDir, roData->unk_00, roData->interfaceFlags & 1);
|
||||
|
@ -1900,26 +1905,28 @@ s32 Camera_Normal3(Camera* camera) {
|
|||
rwData->distTimer--;
|
||||
}
|
||||
|
||||
sp98 = CAM_DATA_SCALED(OREG(25)) * camera->speedRatio;
|
||||
sp94 = CAM_DATA_SCALED(OREG(26)) * camera->speedRatio;
|
||||
sp98 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio;
|
||||
sp94 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y) * camera->speedRatio;
|
||||
|
||||
if (rwData->swing.swingUpdateRateTimer != 0) {
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->yawUpdateSpeed + (rwData->swing.swingUpdateRateTimer * 2),
|
||||
camera->yawUpdateRateInv, sp98, 0.1f);
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF((f32)R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV + (rwData->swing.swingUpdateRateTimer * 2),
|
||||
Camera_LERPCeilF((f32)R_CAM_PITCH_UPDATE_RATE_INV + (rwData->swing.swingUpdateRateTimer * 2),
|
||||
camera->pitchUpdateRateInv, sp94, 0.1f);
|
||||
if (1) {}
|
||||
rwData->swing.swingUpdateRateTimer--;
|
||||
} else {
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->yawUpdateSpeed, camera->yawUpdateRateInv, sp98, 0.1f);
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF(R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, sp94, 0.1f);
|
||||
Camera_LERPCeilF(R_CAM_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv, sp94, 0.1f);
|
||||
}
|
||||
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(2)), camera->xzOffsetUpdateRate, sp98, 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate, sp94, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->fovUpdateRate, sp94, 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE), camera->xzOffsetUpdateRate, sp98, 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate, sp94, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->fovUpdateRate, sp94, 0.1f);
|
||||
|
||||
t2 = Camera_GetPitchAdjFromFloorHeightDiffs(camera, sp7C.yaw - 0x7FFF, true);
|
||||
sp94 = ((1.0f / roData->unk_10) * 0.5f);
|
||||
|
@ -2079,16 +2086,18 @@ s32 Camera_Parallel1(Camera* camera) {
|
|||
camera->animState = 1;
|
||||
}
|
||||
|
||||
spB8 = CAM_DATA_SCALED(OREG(25)) * camera->speedRatio;
|
||||
spB4 = CAM_DATA_SCALED(OREG(26)) * camera->speedRatio;
|
||||
spB8 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio;
|
||||
spB4 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y) * camera->speedRatio;
|
||||
|
||||
camera->rUpdateRateInv = Camera_LERPCeilF(OREG(6), camera->rUpdateRateInv, spB8, 0.1f);
|
||||
camera->rUpdateRateInv = Camera_LERPCeilF(R_CAM_R_UPDATE_RATE_INV, camera->rUpdateRateInv, spB8, 0.1f);
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->unk_08, camera->yawUpdateRateInv, spB8, 0.1f);
|
||||
camera->pitchUpdateRateInv = Camera_LERPCeilF(2.0f, camera->pitchUpdateRateInv, spB4, 0.1f);
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(2)), camera->xzOffsetUpdateRate, spB8, 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate, spB4, 0.1f);
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->fovUpdateRate, camera->speedRatio * 0.05f, 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE), camera->xzOffsetUpdateRate, spB8, 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate, spB4, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->fovUpdateRate,
|
||||
camera->speedRatio * 0.05f, 0.1f);
|
||||
|
||||
if (roData->interfaceFlags & 1) {
|
||||
tangle = Camera_GetPitchAdjFromFloorHeightDiffs(camera, atToEyeDir.yaw - 0x7FFF, true);
|
||||
|
@ -2263,24 +2272,27 @@ s32 Camera_Jump1(Camera* camera) {
|
|||
}
|
||||
|
||||
if (rwData->swing.swingUpdateRateTimer != 0) {
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->yawUpateRateTarget + rwData->swing.swingUpdateRateTimer,
|
||||
camera->yawUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
camera->yawUpdateRateInv =
|
||||
Camera_LERPCeilF(roData->yawUpateRateTarget + rwData->swing.swingUpdateRateTimer, camera->yawUpdateRateInv,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF((f32)R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV + rwData->swing.swingUpdateRateTimer,
|
||||
camera->pitchUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
Camera_LERPCeilF((f32)R_CAM_PITCH_UPDATE_RATE_INV + rwData->swing.swingUpdateRateTimer,
|
||||
camera->pitchUpdateRateInv, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
rwData->swing.swingUpdateRateTimer--;
|
||||
} else {
|
||||
camera->yawUpdateRateInv =
|
||||
Camera_LERPCeilF(roData->yawUpateRateTarget, camera->yawUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
camera->pitchUpdateRateInv = Camera_LERPCeilF((f32)R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV,
|
||||
camera->pitchUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->yawUpateRateTarget, camera->yawUpdateRateInv,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
camera->pitchUpdateRateInv = Camera_LERPCeilF((f32)R_CAM_PITCH_UPDATE_RATE_INV, camera->pitchUpdateRateInv,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
}
|
||||
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(2)), camera->xzOffsetUpdateRate, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->yOffsetUpdateRate, 0.05f, 0.1f);
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE), camera->xzOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->yOffsetUpdateRate, 0.05f, 0.1f);
|
||||
|
||||
func_800458D4(camera, &eyeNextAtOffset, roData->atYOffset, &rwData->unk_1C, 0);
|
||||
|
||||
|
@ -2318,7 +2330,7 @@ s32 Camera_Jump1(Camera* camera) {
|
|||
Camera_AddVecGeoToVec3f(&newEye, at, &eyeDiffGeo);
|
||||
eyeNext->x = newEye.x;
|
||||
eyeNext->z = newEye.z;
|
||||
eyeNext->y += (newEye.y - eyeNext->y) * CAM_DATA_SCALED(OREG(31));
|
||||
eyeNext->y += (newEye.y - eyeNext->y) * CAM_DATA_SCALED(R_CAM_JUMP1_EYE_Y_STEP_SCALE);
|
||||
if ((camera->status == CAM_STAT_ACTIVE) && !(roData->interfaceFlags & 0x10)) {
|
||||
func_80046E20(camera, &eyeDiffGeo, roData->distMin, roData->yawUpateRateTarget, &spA4, &rwData->swing);
|
||||
if (roData->interfaceFlags & 4) {
|
||||
|
@ -2435,14 +2447,15 @@ s32 Camera_Jump2(Camera* camera) {
|
|||
camera->atLERPStepScale = roData->atLERPStepScale;
|
||||
}
|
||||
|
||||
sp90 = CAM_DATA_SCALED(OREG(25)) * camera->speedRatio;
|
||||
sp8C = CAM_DATA_SCALED(OREG(26)) * camera->speedRatio;
|
||||
sp90 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio;
|
||||
sp8C = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y) * camera->speedRatio;
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->yawUpdRateTarget, camera->yawUpdateRateInv, sp90, 0.1f);
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(roData->xzUpdRateTarget, camera->xzOffsetUpdateRate, sp90, 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate, sp8C, 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate, sp8C, 0.1f);
|
||||
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->yOffsetUpdateRate, camera->speedRatio * 0.05f, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->yOffsetUpdateRate,
|
||||
camera->speedRatio * 0.05f, 0.1f);
|
||||
camera->rUpdateRateInv = OREG(27);
|
||||
|
||||
Camera_CalcAtDefault(camera, &atToEyeNextDir, roData->atYOffset, 0);
|
||||
|
@ -2481,14 +2494,16 @@ s32 Camera_Jump2(Camera* camera) {
|
|||
if ((sp90 != BGCHECK_Y_MIN) && (playerPosRot->pos.y < sp90)) {
|
||||
// top of the climb is within 2.2x of the player's height.
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF(20.0f, camera->pitchUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
camera->rUpdateRateInv = Camera_LERPCeilF(20.0f, camera->rUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
Camera_LERPCeilF(20.0f, camera->pitchUpdateRateInv, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
camera->rUpdateRateInv =
|
||||
Camera_LERPCeilF(20.0f, camera->rUpdateRateInv, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
adjAtToEyeDir.pitch = Camera_LERPCeilS(0x1F4, atToEyeNextDir.pitch, 1.0f / camera->pitchUpdateRateInv, 0xA);
|
||||
} else if ((playerPosRot->pos.y - rwData->floorY) < playerHeight) {
|
||||
// player is within his height of the ground.
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF(20.0f, camera->pitchUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
camera->rUpdateRateInv = Camera_LERPCeilF(20.0f, camera->rUpdateRateInv, CAM_DATA_SCALED(OREG(26)), 0.1f);
|
||||
Camera_LERPCeilF(20.0f, camera->pitchUpdateRateInv, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
camera->rUpdateRateInv =
|
||||
Camera_LERPCeilF(20.0f, camera->rUpdateRateInv, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y), 0.1f);
|
||||
adjAtToEyeDir.pitch = Camera_LERPCeilS(0x1F4, atToEyeNextDir.pitch, 1.0f / camera->pitchUpdateRateInv, 0xA);
|
||||
} else {
|
||||
camera->pitchUpdateRateInv = 100.0f;
|
||||
|
@ -2630,9 +2645,9 @@ s32 Camera_Jump3(Camera* camera) {
|
|||
|
||||
spB0 = *eye;
|
||||
|
||||
spC4 = CAM_DATA_SCALED(OREG(25)) * camera->speedRatio;
|
||||
spC0 = camera->speedRatio * CAM_DATA_SCALED(OREG(26));
|
||||
spBC = rwData->swing.unk_18 != 0 ? CAM_DATA_SCALED(OREG(25)) : spC4;
|
||||
spC4 = CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio;
|
||||
spC0 = camera->speedRatio * CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y);
|
||||
spBC = rwData->swing.unk_18 != 0 ? CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) : spC4;
|
||||
|
||||
if (rwData->swing.swingUpdateRateTimer != 0) {
|
||||
camera->yawUpdateRateInv =
|
||||
|
@ -2647,10 +2662,12 @@ s32 Camera_Jump3(Camera* camera) {
|
|||
camera->pitchUpdateRateInv = Camera_LERPCeilF(40.0f, camera->pitchUpdateRateInv, spC0, 0.1f);
|
||||
}
|
||||
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(2)), camera->xzOffsetUpdateRate, spC4, 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate, spC0, 0.1f);
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->yOffsetUpdateRate, camera->speedRatio * 0.05f, 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE), camera->xzOffsetUpdateRate, spC4, 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate, spC0, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->yOffsetUpdateRate,
|
||||
camera->speedRatio * 0.05f, 0.1f);
|
||||
|
||||
Camera_CalcAtDefault(camera, &eyeNextAtOffset, roData->yOffset, roData->interfaceFlags);
|
||||
OLib_Vec3fDiffToVecGeo(&eyeDiffGeo, at, eyeNext);
|
||||
|
@ -2805,12 +2822,13 @@ s32 Camera_Battle1(Camera* camera) {
|
|||
|
||||
if (camera->player->stateFlags1 & PLAYER_STATE1_12) {
|
||||
// charging sword.
|
||||
rwData->unk_10 =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(12)) * 0.5f, rwData->unk_10, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
rwData->unk_10 = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(12)) * 0.5f, rwData->unk_10,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(0.2f, camera->xzOffsetUpdateRate, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(0.2f, camera->yOffsetUpdateRate, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
if (rwData->chargeTimer >= -19) {
|
||||
Camera_LERPCeilF(0.2f, camera->xzOffsetUpdateRate, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(0.2f, camera->yOffsetUpdateRate, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
if (rwData->chargeTimer > -20) {
|
||||
rwData->chargeTimer--;
|
||||
} else {
|
||||
distance = 250.0f;
|
||||
|
@ -2826,14 +2844,17 @@ s32 Camera_Battle1(Camera* camera) {
|
|||
rwData->chargeTimer++;
|
||||
} else {
|
||||
rwData->chargeTimer = 40;
|
||||
rwData->unk_10 = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(12)), rwData->unk_10, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(40)), camera->xzOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(OREG(25)) * camera->speedRatio, 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(40)), camera->yOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(OREG(26)) * camera->speedRatio, 0.1f);
|
||||
rwData->unk_10 = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(12)), rwData->unk_10,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_BATTLE1_XYZ_OFFSET_UPDATE_RATE_TARGET), camera->xzOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio, 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_BATTLE1_XYZ_OFFSET_UPDATE_RATE_TARGET), camera->yOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y) * camera->speedRatio, 0.1f);
|
||||
}
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->fovUpdateRate, camera->speedRatio * 0.05f, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->fovUpdateRate,
|
||||
camera->speedRatio * 0.05f, 0.1f);
|
||||
playerHeight += roData->yOffset;
|
||||
OLib_Vec3fDiffToVecGeo(&atToEyeDir, at, eye);
|
||||
OLib_Vec3fDiffToVecGeo(&atToEyeNextDir, at, eyeNext);
|
||||
|
@ -2980,7 +3001,8 @@ s32 Camera_Battle1(Camera* camera) {
|
|||
*eye = *eyeNext;
|
||||
}
|
||||
}
|
||||
rwData->roll += (((OREG(36) * camera->speedRatio) * (1.0f - distRatio)) - rwData->roll) * CAM_DATA_SCALED(OREG(37));
|
||||
rwData->roll += ((R_CAM_BATTLE1_ROLL_TARGET_BASE * camera->speedRatio * (1.0f - distRatio)) - rwData->roll) *
|
||||
CAM_DATA_SCALED(R_CAM_BATTLE1_ROLL_STEP_SCALE);
|
||||
camera->roll = CAM_DEG_TO_BINANG(rwData->roll);
|
||||
camera->fov = Camera_LERPCeilF((player->meleeWeaponState != 0 ? 0.8f
|
||||
: gSaveContext.health <= 0x10 ? 0.8f
|
||||
|
@ -3047,13 +3069,16 @@ s32 Camera_Battle4(Camera* camera) {
|
|||
break;
|
||||
}
|
||||
|
||||
camera->yawUpdateRateInv = Camera_LERPCeilF(roData->lerpUpdateRate, camera->yawUpdateRateInv,
|
||||
CAM_DATA_SCALED(OREG(25)) * camera->speedRatio, 0.1f);
|
||||
camera->yawUpdateRateInv =
|
||||
Camera_LERPCeilF(roData->lerpUpdateRate, camera->yawUpdateRateInv,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio, 0.1f);
|
||||
camera->rUpdateRateInv = 1000.0f;
|
||||
camera->pitchUpdateRateInv = 1000.0f;
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(0.025f, camera->xzOffsetUpdateRate, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(OREG(3)), camera->yOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(OREG(26)) * camera->speedRatio, 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(0.025f, camera->xzOffsetUpdateRate, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE), camera->yOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y) * camera->speedRatio, 0.1f);
|
||||
camera->fovUpdateRate = 0.0001f;
|
||||
Camera_CalcAtDefault(camera, &eyeNextAtOffset, roData->yOffset, 1);
|
||||
if (rwData->animTimer != 0) {
|
||||
|
@ -3191,12 +3216,14 @@ s32 Camera_KeepOn1(Camera* camera) {
|
|||
rwData->unk_0C = camera->target;
|
||||
camera->atLERPStepScale = 0.0f;
|
||||
}
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(1.0f, camera->xzOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(OREG(25)) * camera->speedRatio, 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(1.0f, camera->xzOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ) * camera->speedRatio, 0.1f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(1.0f, camera->yOffsetUpdateRate, CAM_DATA_SCALED(OREG(26)) * camera->speedRatio, 0.1f);
|
||||
camera->fovUpdateRate =
|
||||
Camera_LERPCeilF(CAM_DATA_SCALED(OREG(4)), camera->fovUpdateRate, camera->speedRatio * 0.05f, 0.1f);
|
||||
Camera_LERPCeilF(1.0f, camera->yOffsetUpdateRate,
|
||||
CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_Y) * camera->speedRatio, 0.1f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), camera->fovUpdateRate,
|
||||
camera->speedRatio * 0.05f, 0.1f);
|
||||
goto cont;
|
||||
case 0x10:
|
||||
rwData->unk_0C = NULL;
|
||||
|
@ -3225,16 +3252,17 @@ s32 Camera_KeepOn1(Camera* camera) {
|
|||
OLib_Vec3fDiffToVecGeo(&spD8, at, eyeNext);
|
||||
if (spD8.r < roData->unk_04) {
|
||||
sp104 = roData->unk_04;
|
||||
spE8 = OREG(6);
|
||||
spE8 = R_CAM_R_UPDATE_RATE_INV;
|
||||
} else if (roData->unk_08 < spD8.r) {
|
||||
sp104 = roData->unk_08;
|
||||
spE8 = OREG(6);
|
||||
spE8 = R_CAM_R_UPDATE_RATE_INV;
|
||||
} else {
|
||||
sp104 = spD8.r;
|
||||
spE8 = 1.0f;
|
||||
}
|
||||
|
||||
camera->rUpdateRateInv = Camera_LERPCeilF(spE8, camera->rUpdateRateInv, CAM_DATA_SCALED(OREG(25)), 0.1f);
|
||||
camera->rUpdateRateInv =
|
||||
Camera_LERPCeilF(spE8, camera->rUpdateRateInv, CAM_DATA_SCALED(R_CAM_UPDATE_RATE_STEP_SCALE_XZ), 0.1f);
|
||||
spD8.r = spE8 = camera->dist = Camera_LERPCeilF(sp104, camera->dist, 1.0f / camera->rUpdateRateInv, 0.2f);
|
||||
sp108 = camera->targetPosRot.pos;
|
||||
OLib_Vec3fDiffToVecGeo(&spD0, at, &sp108);
|
||||
|
@ -4622,11 +4650,15 @@ s32 Camera_Unique1(Camera* camera) {
|
|||
|
||||
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);
|
||||
camera->xzOffsetUpdateRate = Camera_LERPCeilF(0.005f, camera->xzOffsetUpdateRate, OREG(25) * 0.01f, 0.01f);
|
||||
camera->yOffsetUpdateRate = Camera_LERPCeilF(0.01f, camera->yOffsetUpdateRate, OREG(26) * 0.01f, 0.01f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(OREG(4) * 0.01f, camera->fovUpdateRate, 0.05f, 0.1f);
|
||||
camera->yawUpdateRateInv =
|
||||
Camera_LERPCeilF(100.0f, camera->yawUpdateRateInv, R_CAM_UPDATE_RATE_STEP_SCALE_XZ * 0.01f, 0.1f);
|
||||
camera->pitchUpdateRateInv =
|
||||
Camera_LERPCeilF(100.0f, camera->pitchUpdateRateInv, R_CAM_UPDATE_RATE_STEP_SCALE_XZ * 0.01f, 0.1f);
|
||||
camera->xzOffsetUpdateRate =
|
||||
Camera_LERPCeilF(0.005f, camera->xzOffsetUpdateRate, R_CAM_UPDATE_RATE_STEP_SCALE_XZ * 0.01f, 0.01f);
|
||||
camera->yOffsetUpdateRate =
|
||||
Camera_LERPCeilF(0.01f, camera->yOffsetUpdateRate, R_CAM_UPDATE_RATE_STEP_SCALE_Y * 0.01f, 0.01f);
|
||||
camera->fovUpdateRate = Camera_LERPCeilF(R_CAM_FOV_UPDATE_RATE * 0.01f, camera->fovUpdateRate, 0.05f, 0.1f);
|
||||
|
||||
Camera_CalcAtDefault(camera, &eyeNextAtOffset, roData->yOffset, 1);
|
||||
OLib_Vec3fDiffToVecGeo(&sp8C, at, eyeNext);
|
||||
|
@ -6563,8 +6595,8 @@ s32 Camera_Special5(Camera* camera) {
|
|||
}
|
||||
|
||||
Camera_CalcAtDefault(camera, &sp5C, roData->yOffset, 0);
|
||||
camera->fov =
|
||||
Camera_LERPCeilF(roData->fovTarget, camera->fov, camera->atLERPStepScale * CAM_DATA_SCALED(OREG(4)), 1.0f);
|
||||
camera->fov = Camera_LERPCeilF(roData->fovTarget, camera->fov,
|
||||
camera->atLERPStepScale * CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE), 1.0f);
|
||||
camera->roll = Camera_LERPCeilS(0, camera->roll, 0.5f, 0xA);
|
||||
camera->atLERPStepScale = Camera_ClampLERPScale(camera, roData->atMaxLERPScale);
|
||||
return true;
|
||||
|
@ -6958,10 +6990,10 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState
|
|||
camera->up.y = 1.0f;
|
||||
camera->up.z = 0.0f;
|
||||
camera->fov = 60.0f;
|
||||
camera->pitchUpdateRateInv = R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV;
|
||||
camera->xzOffsetUpdateRate = CAM_DATA_SCALED(OREG(2));
|
||||
camera->yOffsetUpdateRate = CAM_DATA_SCALED(OREG(3));
|
||||
camera->fovUpdateRate = CAM_DATA_SCALED(OREG(4));
|
||||
camera->pitchUpdateRateInv = R_CAM_PITCH_UPDATE_RATE_INV;
|
||||
camera->xzOffsetUpdateRate = CAM_DATA_SCALED(R_CAM_XZ_OFFSET_UPDATE_RATE);
|
||||
camera->yOffsetUpdateRate = CAM_DATA_SCALED(R_CAM_Y_OFFSET_UPDATE_RATE);
|
||||
camera->fovUpdateRate = CAM_DATA_SCALED(R_CAM_FOV_UPDATE_RATE);
|
||||
sCameraLetterboxSize = 32;
|
||||
sCameraInterfaceAlpha = 0;
|
||||
camera->unk_14C = 0;
|
||||
|
|
|
@ -29,21 +29,21 @@ typedef struct {
|
|||
s16 sOREGInit[] = {
|
||||
0, // OREG(0)
|
||||
1, // OREG(1)
|
||||
5, // OREG(2)
|
||||
5, // OREG(3)
|
||||
5, // OREG(4)
|
||||
5, // R_CAM_XZ_OFFSET_UPDATE_RATE
|
||||
5, // R_CAM_Y_OFFSET_UPDATE_RATE
|
||||
5, // R_CAM_FOV_UPDATE_RATE
|
||||
14500, // R_CAM_MAX_PITCH
|
||||
20, // OREG(6)
|
||||
16, // R_CAM_DEFAULT_PITCH_UPDATE_RATE_INV
|
||||
20, // R_CAM_R_UPDATE_RATE_INV
|
||||
16, // R_CAM_PITCH_UPDATE_RATE_INV
|
||||
150, // OREG(8)
|
||||
25, // OREG(9)
|
||||
25, // R_CAM_SLOPE_Y_ADJ_AMOUNT
|
||||
150, // OREG(10)
|
||||
6, // OREG(11)
|
||||
10, // OREG(12)
|
||||
10, // OREG(13)
|
||||
0, // OREG(14)
|
||||
0, // OREG(15)
|
||||
1, // OREG(16)
|
||||
0, // OREG(14) (unused)
|
||||
0, // OREG(15) (unused)
|
||||
1, // OREG(16) (unused)
|
||||
100, // R_CAM_PITCH_FLOOR_CHECK_NEAR_DIST_FAC
|
||||
250, // R_CAM_PITCH_FLOOR_CHECK_FAR_DIST_FAC
|
||||
120, // R_CAM_PITCH_FLOOR_CHECK_OFFSET_Y_FAC
|
||||
|
@ -52,29 +52,29 @@ s16 sOREGInit[] = {
|
|||
120, // OREG(22)
|
||||
4, // R_CAM_DEFAULT_ANIM_TIME
|
||||
1, // OREG(24)
|
||||
50, // OREG(25)
|
||||
20, // OREG(26)
|
||||
50, // R_CAM_UPDATE_RATE_STEP_SCALE_XZ
|
||||
20, // R_CAM_UPDATE_RATE_STEP_SCALE_Y
|
||||
1800, // OREG(27)
|
||||
50, // OREG(28)
|
||||
50, // OREG(29)
|
||||
50, // OREG(30)
|
||||
20, // OREG(31)
|
||||
20, // R_CAM_JUMP1_EYE_Y_STEP_SCALE
|
||||
20, // OREG(32)
|
||||
-10, // OREG(33)
|
||||
-5460, // R_CAM_MIN_PITCH_1
|
||||
-9100, // R_CAM_MIN_PITCH_2
|
||||
-6, // OREG(36)
|
||||
8, // OREG(37)
|
||||
-6, // R_CAM_BATTLE1_ROLL_TARGET_BASE
|
||||
8, // R_CAM_BATTLE1_ROLL_STEP_SCALE
|
||||
15, // OREG(38)
|
||||
75, // OREG(39)
|
||||
60, // OREG(40)
|
||||
60, // R_CAM_BATTLE1_XYZ_OFFSET_UPDATE_RATE_TARGET
|
||||
12, // R_CAM_AT_LERP_STEP_SCALE_MIN
|
||||
110, // R_CAM_AT_LERP_STEP_SCALE_FAC
|
||||
40, // OREG(43)
|
||||
50, // OREG(44)
|
||||
250, // OREG(45)
|
||||
-10, // R_CAM_YOFFSET_NORM
|
||||
30, // OREG(47)
|
||||
30, // OREG(47) (unused)
|
||||
30, // OREG(48)
|
||||
70, // OREG(49)
|
||||
20, // OREG(50)
|
||||
|
|
Loading…
Reference in a new issue