mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 04:00:53 +00:00
- PlayerAngle: Adjust how settarget()
methods store angle for unsynchronised angle adjustments and adjust processhelpers()
method accordingly.
* Repairs angle issues raised in https://forum.zdoom.org/viewtopic.php?f=340&p=1185365.
This commit is contained in:
parent
a12f277846
commit
39fe9efaff
1 changed files with 15 additions and 15 deletions
|
@ -97,9 +97,9 @@ struct PlayerHorizon
|
||||||
|
|
||||||
struct PlayerAngle
|
struct PlayerAngle
|
||||||
{
|
{
|
||||||
binangle ang, oang;
|
binangle ang, oang, target;
|
||||||
lookangle look_ang, olook_ang, rotscrnang, orotscrnang, spin;
|
lookangle look_ang, olook_ang, rotscrnang, orotscrnang, spin;
|
||||||
double adjustment, target;
|
double adjustment;
|
||||||
|
|
||||||
void backup()
|
void backup()
|
||||||
{
|
{
|
||||||
|
@ -172,12 +172,12 @@ struct PlayerAngle
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
if (!SyncInput() && !backup)
|
||||||
{
|
{
|
||||||
target = (ang + getincanglebam(ang, buildang(value))).asbam();
|
target = buildang(value & 2047);
|
||||||
if (target == 0) target += 1;
|
if (target.asbam() == 0) target = bamang(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ang = buildang(value);
|
ang = buildang(value & 2047);
|
||||||
if (backup) oang = ang;
|
if (backup) oang = ang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,12 +186,12 @@ struct PlayerAngle
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
if (!SyncInput() && !backup)
|
||||||
{
|
{
|
||||||
target = (ang + getincanglebam(ang, buildfang(value))).asbam();
|
target = buildfang(fmod(value, 2048));
|
||||||
if (target == 0) target += 1;
|
if (target.asbam() == 0) target = bamang(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ang = buildfang(value);
|
ang = buildfang(fmod(value, 2048));
|
||||||
if (backup) oang = ang;
|
if (backup) oang = ang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,8 +200,8 @@ struct PlayerAngle
|
||||||
{
|
{
|
||||||
if (!SyncInput() && !backup)
|
if (!SyncInput() && !backup)
|
||||||
{
|
{
|
||||||
target = (ang + getincanglebam(ang, value)).asbam();
|
target = value;
|
||||||
if (target == 0) target += 1;
|
if (target.asbam() == 0) target = bamang(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -212,14 +212,14 @@ struct PlayerAngle
|
||||||
|
|
||||||
void processhelpers(double const scaleAdjust)
|
void processhelpers(double const scaleAdjust)
|
||||||
{
|
{
|
||||||
if (target)
|
if (target.asbam())
|
||||||
{
|
{
|
||||||
ang += bamang(xs_CRoundToUInt(scaleAdjust * (target - ang.asbam())));
|
ang += bamang(xs_CRoundToUInt(scaleAdjust * getincanglebam(ang, target).asbam()));
|
||||||
|
|
||||||
if (abs(ang.asbam() - target) < BAMUNIT)
|
if (getincanglebam(ang, target).asbam() < BAMUNIT)
|
||||||
{
|
{
|
||||||
ang = bamang(target);
|
ang = target;
|
||||||
target = 0;
|
target = bamang(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (adjustment)
|
else if (adjustment)
|
||||||
|
|
Loading…
Reference in a new issue