mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-14 03:21:24 +01:00
Use absolute yaw difference for comparison.
This commit is contained in:
parent
802c1bef06
commit
a823e6dd1e
@ -70,8 +70,10 @@ public class Combined {
|
|||||||
data.lastYaw = yaw;
|
data.lastYaw = yaw;
|
||||||
data.lastYawTime = now;
|
data.lastYawTime = now;
|
||||||
|
|
||||||
|
final float dAbs = Math.abs(yawDiff);
|
||||||
|
|
||||||
// Skip adding small changes.
|
// Skip adding small changes.
|
||||||
if (yawDiff < stationary){
|
if (dAbs < stationary){
|
||||||
// This could also be done by keeping a "stationaryYaw" and taking the distance to yaw.
|
// This could also be done by keeping a "stationaryYaw" and taking the distance to yaw.
|
||||||
data.sumYaw += yawDiff;
|
data.sumYaw += yawDiff;
|
||||||
if (Math.abs(data.sumYaw) < stationary){
|
if (Math.abs(data.sumYaw) < stationary){
|
||||||
@ -86,7 +88,7 @@ public class Combined {
|
|||||||
}
|
}
|
||||||
else data.sumYaw = 0f;
|
else data.sumYaw = 0f;
|
||||||
|
|
||||||
final float dAbs = Math.abs(yawDiff);
|
// Normalize yaw-change vs. elapsed time.
|
||||||
final float dNorm = (float) dAbs / (float) (1 + elapsed);
|
final float dNorm = (float) dAbs / (float) (1 + elapsed);
|
||||||
|
|
||||||
data.yawFreq.add(now, dNorm);
|
data.yawFreq.add(now, dNorm);
|
||||||
|
Loading…
Reference in New Issue
Block a user