mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 17:11:20 -08:00
fix size/capacity of circle buffer
This commit is contained in:
1 parent
4d2083df27
commit
74ccaa6cf1
1 file changed
+2
-2
@@ -109,7 +109,7 @@ public class IMUTracker implements Tracker, TrackerWithTPS, TrackerWithBattery {
|
||||
movementFilterAmount = 1f;
|
||||
movementFilterTickCount = 0;
|
||||
}
|
||||
previousRots = new CircularArrayList<Quaternion>(movementFilterTickCount);
|
||||
previousRots = new CircularArrayList<Quaternion>(movementFilterTickCount + 1);
|
||||
}
|
||||
public TrackerMountingRotation getMountingRotation() {
|
||||
return mounting;
|
||||
@@ -136,7 +136,7 @@ public class IMUTracker implements Tracker, TrackerWithTPS, TrackerWithBattery {
|
||||
}
|
||||
if(movementFilterTickCount != 0){
|
||||
previousRots.add(rotQuaternion.clone());
|
||||
if(previousRots.size() > movementFilterTickCount - 1){
|
||||
if(previousRots.size() > movementFilterTickCount){
|
||||
previousRots.remove(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user