mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
Fixed camera not rotating when Link is moving
This commit is contained in:
parent
31d1c17bd5
commit
15adf92e45
1 changed files with 7 additions and 12 deletions
|
@ -1415,22 +1415,17 @@ f32 camX;
|
||||||
f32 camY;
|
f32 camY;
|
||||||
|
|
||||||
s32 SetCameraManual(Camera* camera) {
|
s32 SetCameraManual(Camera* camera) {
|
||||||
auto newCamX = -D_8015BD7C->state.input[0].cur.cam_x;
|
f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x;
|
||||||
auto newCamY = D_8015BD7C->state.input[0].cur.cam_y;
|
f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y;
|
||||||
|
|
||||||
if (fabsf(newCamX) >= 350.0f || fabsf(newCamY) >= 350.0f && manualCamera == false) {
|
if ((fabsf(newCamX) >= 350.0f || fabsf(newCamY) >= 350.0f) && manualCamera == false) {
|
||||||
manualCamera = true;
|
manualCamera = true;
|
||||||
|
|
||||||
VecSph eyeAdjustment1;
|
VecSph eyeAdjustment;
|
||||||
Vec3f oldCamRot;
|
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &camera->playerPosRot, &camera->eye);
|
||||||
oldCamRot.x = camera->player->actor.world.pos.x;
|
|
||||||
oldCamRot.y = camera->player->actor.world.pos.y + Player_GetHeight(camera->player);
|
|
||||||
oldCamRot.z = camera->player->actor.world.pos.z;
|
|
||||||
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment1, &oldCamRot, &camera->eye);
|
|
||||||
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment1, &oldCamRot, &camera->eyeNext);
|
|
||||||
|
|
||||||
camX = eyeAdjustment1.yaw;
|
camX = eyeAdjustment.yaw;
|
||||||
camY = eyeAdjustment1.pitch;
|
camY = eyeAdjustment.pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (manualCamera) {
|
if (manualCamera) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue