revert e30f1f0f35
revert Merge branch 'main' of https://git.skbkit.ru/CPL/Simulator
This commit is contained in:
@ -225,7 +225,7 @@ namespace DroneSimulator
|
||||
|
||||
public void Update(float value, uint time)
|
||||
{
|
||||
value = Pressure - value * 12.15f;
|
||||
value = Pressure - value;
|
||||
|
||||
if (!Enable)
|
||||
{
|
||||
@ -273,6 +273,8 @@ 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;
|
||||
|
||||
@ -288,21 +290,31 @@ namespace DroneSimulator
|
||||
|
||||
public uint timer = 0;
|
||||
public Vector2 result;
|
||||
public bool Update(Vector2 value, float Range, uint time)
|
||||
public void Update(Vector2 value, float Range, uint time)
|
||||
{
|
||||
value *= Lens;
|
||||
|
||||
if (!Enable)
|
||||
{
|
||||
result = Vector2.NaN;
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!RealSimulation)
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
value *= Lens;
|
||||
|
||||
if (rand.Next(0, 1000) < (Error * 10))
|
||||
{
|
||||
value = Vector2.Zero;
|
||||
delay = time + Wait;
|
||||
}
|
||||
else if (delay > time)
|
||||
{
|
||||
value = Vector2.Zero;
|
||||
}
|
||||
|
||||
if (Range > MaxHeight) value = Vector2.Zero;
|
||||
@ -332,10 +344,7 @@ namespace DroneSimulator
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user