mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-27 10:57:47 +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.lastYawTime = now;
|
||||
|
||||
final float dAbs = Math.abs(yawDiff);
|
||||
|
||||
// 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.
|
||||
data.sumYaw += yawDiff;
|
||||
if (Math.abs(data.sumYaw) < stationary){
|
||||
@ -86,7 +88,7 @@ public class Combined {
|
||||
}
|
||||
else data.sumYaw = 0f;
|
||||
|
||||
final float dAbs = Math.abs(yawDiff);
|
||||
// Normalize yaw-change vs. elapsed time.
|
||||
final float dNorm = (float) dAbs / (float) (1 + elapsed);
|
||||
|
||||
data.yawFreq.add(now, dNorm);
|
||||
|
Loading…
Reference in New Issue
Block a user