+++
This commit is contained in:
@ -273,8 +273,6 @@ namespace DroneSimulator
|
||||
public static uint Freq;
|
||||
public static float Noise;
|
||||
public static float Lateness;
|
||||
public static float Error;
|
||||
public static uint Wait;
|
||||
public static float Lens;
|
||||
public static bool RealSimulation;
|
||||
|
||||
@ -290,31 +288,21 @@ namespace DroneSimulator
|
||||
|
||||
public uint timer = 0;
|
||||
public Vector2 result;
|
||||
public void Update(Vector2 value, float Range, uint time)
|
||||
public bool Update(Vector2 value, float Range, uint time)
|
||||
{
|
||||
value *= Lens;
|
||||
|
||||
if (!Enable)
|
||||
{
|
||||
result = Vector2.NaN;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!RealSimulation)
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return;
|
||||
}
|
||||
|
||||
value *= Lens;
|
||||
|
||||
if (rand.Next(0, 1000) < (Error * 10))
|
||||
{
|
||||
value = Vector2.Zero;
|
||||
delay = time + Wait;
|
||||
}
|
||||
else if (delay > time)
|
||||
{
|
||||
value = Vector2.Zero;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Range > MaxHeight) value = Vector2.Zero;
|
||||
@ -344,7 +332,10 @@ namespace DroneSimulator
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user