Skip to content

Commit

Permalink
fix rotation again
Browse files Browse the repository at this point in the history
  • Loading branch information
headshot2017 committed Feb 5, 2024
1 parent d85e3b6 commit ade48c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,13 +853,15 @@ void marioTick(float dt)

float orX = asinf(ped->GetMatrix()->up.z);
float cosx = cosf(orX);
float cosy = ped->GetMatrix()->at.z / cosx;
float cosy = CLAMP(ped->GetMatrix()->at.z / cosx, 0, 1);
float orY = acosf(cosy);
if (ped->GetMatrix()->right.z < 0) orY = -orY;
/*
float orX = ped->GetMatrix()->up.z;
float orY = ped->GetMatrix()->right.z;
*/


sm64_set_mario_angle(marioId, -orX, faceangle, -orY);
sm64_set_mario_torsoangle(marioId, (tiltForward ? 0.4f : 0), 0, 0);
sm64_set_mario_position(marioId, sm64pos.x, sm64pos.y, sm64pos.z);
Expand Down

0 comments on commit ade48c9

Please sign in to comment.