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