mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
- check for angular overflow in pitch calculations.
This commit is contained in:
parent
a0fa0560d4
commit
4aaf6c4cf6
2 changed files with 2 additions and 0 deletions
|
@ -5507,6 +5507,7 @@ RECHECK:
|
|||
}
|
||||
}
|
||||
|
||||
horizAngle = clamp(horizAngle, -255.f, 255.f); // keep the angle within ]-90°..90°[
|
||||
pPlayer->q16horiz = F16(100) + Blrintf(F16(128) * tanf(horizAngle * (fPI / 512.f)));
|
||||
|
||||
if (pPlayer->return_to_center > 0 && !TEST_SYNC_KEY(playerBits, SK_LOOK_UP) && !TEST_SYNC_KEY(playerBits, SK_LOOK_DOWN))
|
||||
|
|
|
@ -282,6 +282,7 @@ void PlayerInterruptKeys()
|
|||
// so we convert horiz to 1024 angle units
|
||||
|
||||
float horizAngle = atan2f(nVertPan[nLocalPlayer] - F16(92), F16(128)) * (512.f / fPI) + fix16_to_float(q16horz);
|
||||
horizAngle = clamp(horizAngle, -255.f, 255.f);
|
||||
nVertPan[nLocalPlayer] = fix16_clamp(F16(92) + Blrintf(F16(128) * tanf(horizAngle * (fPI / 512.f))), F16(0), F16(184));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue