+++
This commit is contained in:
@ -40,7 +40,6 @@ namespace DroneSimulator
|
||||
public static bool TimeLimit = false;
|
||||
|
||||
private Vector2 MoveOF = Vector2.Zero;
|
||||
private uint CountOF = 0;
|
||||
private bool ReadyOF = false;
|
||||
|
||||
public struct Physics
|
||||
@ -366,8 +365,7 @@ namespace DroneSimulator
|
||||
|
||||
lock (this)
|
||||
{
|
||||
MoveOF += RealOF.result;
|
||||
CountOF += 1;
|
||||
MoveOF += RealOF.result * time;
|
||||
|
||||
if (of) ReadyOF = true;
|
||||
}
|
||||
@ -533,10 +531,11 @@ namespace DroneSimulator
|
||||
|
||||
lock (this)
|
||||
{
|
||||
if (ReadyOF && CountOF != 0)
|
||||
if (ReadyOF)
|
||||
{
|
||||
of.X = MoveOF.X / CountOF;
|
||||
of.Y = MoveOF.Y / CountOF;
|
||||
of.X = MoveOF.X;
|
||||
of.Y = MoveOF.Y;
|
||||
MoveOF = Vector2.Zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -546,8 +545,6 @@ namespace DroneSimulator
|
||||
|
||||
of.Time = RealOF.timer;
|
||||
|
||||
MoveOF = Vector2.Zero;
|
||||
CountOF = 0;
|
||||
ReadyOF = false;
|
||||
}
|
||||
|
||||
|
@ -332,12 +332,11 @@ namespace DroneSimulator
|
||||
return true;
|
||||
}
|
||||
|
||||
v = laten[index];
|
||||
result = laten[index];
|
||||
|
||||
uint freq = 1000 / Freq;
|
||||
if (timer + freq <= time)
|
||||
{
|
||||
result = v;
|
||||
timer = time;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user