diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2024-10-24 11:44:44 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-23 17:44:44 -0700 |
| commit | d60a032b114484a67add15bbfd6ba6a958a5bee3 (patch) | |
| tree | 677086bc1ab52d63a7a88aba3e6ae49bcbf3c034 /src/code/z_camera.c | |
| parent | 5a958cad4d5ee29bab345381fd2f366ad620beb1 (diff) | |
Further Attention Docs (#1732)
* more attention docs
* more docs
* cleanup
* more cleanup
* spacing
* more attention docs
* small cleanup
* consistency
Diffstat (limited to 'src/code/z_camera.c')
| -rw-r--r-- | src/code/z_camera.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/code/z_camera.c b/src/code/z_camera.c index ab9252ad9..b2570386f 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -1274,9 +1274,12 @@ f32 Camera_CalcSlopeYAdj(Vec3f* floorNorm, s16 playerYRot, s16 eyeAtYaw, f32 adj return (Camera_fabsf(tmp) * adjAmt) * Math_CosS(playerYRot - eyeAtYaw); } -f32 func_800CD6CC(Actor* actor) { - return sqrtf(gAttentionRanges[actor->attentionRangeType].rangeSq / - gAttentionRanges[actor->attentionRangeType].leashScale); +/** + * Gets the distance that the attention actor is in range. + */ +f32 Camera_GetAttentionActorRange(Actor* actor) { + return sqrtf(gAttentionRanges[actor->attentionRangeType].attentionRangeSq / + gAttentionRanges[actor->attentionRangeType].lockOnLeashScale); } /** @@ -1950,7 +1953,7 @@ s32 Camera_Normal1(Camera* camera) { Vec3f spD8; f32 spD4; f32 spD0; - Vec3f* temp; + Vec3f* cameraDriftActorPos; f32 spC8; f32 spC4; f32 spC0; @@ -2095,7 +2098,7 @@ s32 Camera_Normal1(Camera* camera) { camera->yawUpdateRateInv, phi_f2, 0.1f); if ((roData->interfaceFlags & NORMAL1_FLAG_3) && (camera->speedRatio > 0.01f)) { camera->pitchUpdateRateInv = Camera_ScaledStepToCeilF(100.0f, camera->pitchUpdateRateInv, 0.5f, 0.1f); - } else if (D_801ED920 != NULL) { + } else if (gCameraDriftActor != NULL) { camera->pitchUpdateRateInv = Camera_ScaledStepToCeilF(32.0f, camera->pitchUpdateRateInv, 0.5f, 0.1f); } else { camera->pitchUpdateRateInv = Camera_ScaledStepToCeilF(16.0f, camera->pitchUpdateRateInv, 0.2f, 0.1f); @@ -2202,7 +2205,7 @@ s32 Camera_Normal1(Camera* camera) { spB4.yaw = sp9C.yaw; spB4.pitch = sp9C.pitch; camera->animState = 20; - } else if (D_801ED920 != NULL) { + } else if (gCameraDriftActor != NULL) { VecGeo sp74; s16 sp72; f32 sp6C; @@ -2210,8 +2213,8 @@ s32 Camera_Normal1(Camera* camera) { //! FAKE: if (1) {} - temp = &D_801ED920->world.pos; - sp74 = OLib_Vec3fDiffToVecGeo(&focalActorPosRot->pos, temp); + cameraDriftActorPos = &gCameraDriftActor->world.pos; + sp74 = OLib_Vec3fDiffToVecGeo(&focalActorPosRot->pos, cameraDriftActorPos); sp72 = focalActorPosRot->rot.y - sp74.yaw; // Interface and shrink-window flags if ((roData->interfaceFlags & 0xFF00) == 0xFF00) { @@ -3683,7 +3686,7 @@ s32 Camera_Battle1(Camera* camera) { sp120.y += focalActorHeight; spA4 = OLib_Vec3fDiffToVecGeo(&sp120, &camera->targetPosRot.pos); - sp104 = func_800CD6CC(camera->target); + sp104 = Camera_GetAttentionActorRange(camera->target); if (sp104 > (PREG(86) + 800.0f)) { sp104 = PREG(86) + 800.0f; } |
