mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-26 11:56:27 -08:00
fixed a NullPointerException
When the type was null oops
This commit is contained in:
1 parent
8c74071e30
commit
82779d101b
1 file changed
+20
-14
@@ -88,20 +88,26 @@ public class IMUTracker implements Tracker, TrackerWithTPS, TrackerWithBattery {
|
||||
public void setFilter(String type, float amount, int ticks){
|
||||
amount = FastMath.clamp(amount, 0, 1f);
|
||||
ticks = (int) FastMath.clamp(ticks, 0, 80);
|
||||
switch(type){
|
||||
case "INTERPOLATION":
|
||||
movementFilterAmount = 1f - (amount / 1.75f);
|
||||
movementFilterTickCount = ticks;
|
||||
break;
|
||||
case "EXTRAPOLATION":
|
||||
movementFilterAmount = 1f + (amount * 1.1f);
|
||||
movementFilterTickCount = ticks;
|
||||
break;
|
||||
case "NONE":
|
||||
default:
|
||||
movementFilterAmount = 1f;
|
||||
movementFilterTickCount = 0;
|
||||
break;
|
||||
if(type != null){
|
||||
switch(type){
|
||||
case "INTERPOLATION":
|
||||
movementFilterAmount = 1f - (amount / 1.75f);
|
||||
movementFilterTickCount = ticks;
|
||||
break;
|
||||
case "EXTRAPOLATION":
|
||||
movementFilterAmount = 1f + (amount * 1.1f);
|
||||
movementFilterTickCount = ticks;
|
||||
break;
|
||||
case "NONE":
|
||||
default:
|
||||
movementFilterAmount = 1f;
|
||||
movementFilterTickCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
movementFilterAmount = 1f;
|
||||
movementFilterTickCount = 0;
|
||||
}
|
||||
}
|
||||
public TrackerMountingRotation getMountingRotation() {
|
||||
|
||||
Reference in new issue
Block a user