forked from CPL/Simulator
;)
This commit is contained in:
@ -27,12 +27,17 @@ namespace DroneSimulator
|
||||
private Vector3[] laten = new Vector3[count];
|
||||
private uint index = 0;
|
||||
|
||||
private uint timer = 0;
|
||||
private Vector3 result;
|
||||
public uint timer = 0;
|
||||
public Vector3 result;
|
||||
|
||||
public void Update(ref Vector3 value, ref uint time)
|
||||
public void Update(Vector3 value, uint time)
|
||||
{
|
||||
if (!RealSimulation) return;
|
||||
if (!RealSimulation)
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return;
|
||||
}
|
||||
|
||||
float scale = (ScaleRight - ScaleLeft) / 2;
|
||||
float shift = scale + ScaleLeft;
|
||||
@ -66,11 +71,6 @@ namespace DroneSimulator
|
||||
result = value;
|
||||
timer = time;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = result;
|
||||
time = timer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,12 +89,17 @@ namespace DroneSimulator
|
||||
private Vector3[] laten = new Vector3[count];
|
||||
private uint index = 0;
|
||||
|
||||
private uint timer = 0;
|
||||
private Vector3 result;
|
||||
public uint timer = 0;
|
||||
public Vector3 result;
|
||||
|
||||
public void Update(ref Vector3 value, ref uint time)
|
||||
public void Update(Vector3 value, uint time)
|
||||
{
|
||||
if (!RealSimulation) return;
|
||||
if (!RealSimulation)
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return;
|
||||
}
|
||||
|
||||
value.X += Shift.X;
|
||||
value.Y += Shift.Y;
|
||||
@ -125,11 +130,6 @@ namespace DroneSimulator
|
||||
result = value;
|
||||
timer = time;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = result;
|
||||
time = timer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,13 +153,23 @@ namespace DroneSimulator
|
||||
private Vector3[] laten = new Vector3[count];
|
||||
private uint index = 0;
|
||||
|
||||
private uint timer = 0;
|
||||
private Vector3 result;
|
||||
public uint timer = 0;
|
||||
public Vector3 result;
|
||||
|
||||
public void Update(ref Vector3 value, ref uint time)
|
||||
public void Update(Vector3 value, uint time)
|
||||
{
|
||||
if (!RealSimulation) return;
|
||||
if (!Enable) { value = result; time = timer; return; }
|
||||
if (!RealSimulation)
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Enable)
|
||||
{
|
||||
result = Vector3.NaN;
|
||||
return;
|
||||
}
|
||||
|
||||
int noise = (int)(Noise * 1000);
|
||||
value.X += ((float)rand.Next(-noise, noise)) / 1000;
|
||||
@ -186,11 +196,6 @@ namespace DroneSimulator
|
||||
result = value;
|
||||
timer = time;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = result;
|
||||
time = timer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,16 +215,25 @@ namespace DroneSimulator
|
||||
private float[] laten = new float[count];
|
||||
private uint index = 0;
|
||||
|
||||
private uint timer = 0;
|
||||
private float result;
|
||||
public uint timer = 0;
|
||||
public float result;
|
||||
|
||||
public void Update(ref float value, ref uint time)
|
||||
public void Update(float value, uint time)
|
||||
{
|
||||
if (!Enable) { value = result; time = timer; return; }
|
||||
|
||||
value = Pressure - value;
|
||||
|
||||
if (!RealSimulation) return;
|
||||
if (!RealSimulation)
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Enable)
|
||||
{
|
||||
result = float.NaN;
|
||||
return;
|
||||
}
|
||||
|
||||
int noise = (int)(Noise * 1000);
|
||||
value += ((float)rand.Next(-noise, noise)) / 1000;
|
||||
@ -244,11 +258,6 @@ namespace DroneSimulator
|
||||
result = value;
|
||||
timer = time;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = result;
|
||||
time = timer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -273,18 +282,30 @@ namespace DroneSimulator
|
||||
private float[] laten = new float[count];
|
||||
private uint index = 0;
|
||||
|
||||
private uint timer = 0;
|
||||
private float result;
|
||||
public uint timer = 0;
|
||||
public float result;
|
||||
|
||||
public void Update(ref float value, ref uint time)
|
||||
public void Update(float value, uint time)
|
||||
{
|
||||
if (!RealSimulation) return;
|
||||
if (!Enable) { value = result; time = timer; return; }
|
||||
if (!RealSimulation)
|
||||
{
|
||||
result = value;
|
||||
timer = time;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Enable)
|
||||
{
|
||||
result = float.NaN;
|
||||
return;
|
||||
}
|
||||
|
||||
if (value > MaxHeight) value = -1;
|
||||
|
||||
int noise = (int)(Noise * 1000);
|
||||
value += ((float)rand.Next(-noise, noise)) / 1000;
|
||||
else
|
||||
{
|
||||
int noise = (int)(Noise * 1000);
|
||||
value += ((float)rand.Next(-noise, noise)) / 1000;
|
||||
}
|
||||
|
||||
uint clock = (uint)(Lateness * 1000);
|
||||
|
||||
@ -306,11 +327,6 @@ namespace DroneSimulator
|
||||
result = value;
|
||||
timer = time;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = result;
|
||||
time = timer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user