Skip to content

Commit

Permalink
fix camLook mario movement
Browse files Browse the repository at this point in the history
holding the "look behind" button will no longer make mario turn 180 degrees.
if you put the camera directly above mario's head (full upwards), movement will no longer be erratic
  • Loading branch information
headshot2017 committed Jan 12, 2024
1 parent ea1d9c4 commit a8ed048
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ void marioTick(float dt)
marioInput.buttonA = jumpState;
marioInput.buttonB = attackState;
marioInput.buttonZ = duckState;
marioInput.camLookX = TheCamera.GetPosition().x/MARIO_SCALE - marioState.position[0];
marioInput.camLookZ = -TheCamera.GetPosition().y/MARIO_SCALE - marioState.position[2];
marioInput.camLookX = TheCamera.m_fCamFrontXNorm * (pad->GetLookBehindForPed() ? 1 : -1);
marioInput.camLookZ = TheCamera.m_fCamFrontYNorm * (pad->GetLookBehindForPed() ? -1 : 1);

if (marioState.action == ACT_DRIVING_VEHICLE) sm64_set_mario_action(marioId, ACT_FREEFALL);
}
Expand Down

0 comments on commit a8ed048

Please sign in to comment.