Advertisement
Guest User

Untitled

a guest
Aug 8th, 2019
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.11 KB | None | 0 0
  1. diff --git a/Assets/AstarPathfindingProject/Core/RVO/RVOCoreSimulator.cs b/Assets/AstarPathfindingProject/Core/RVO/RVOCoreSimulator.cs
  2. index 930efd1c..49e07b52 100644
  3. --- a/Assets/AstarPathfindingProject/Core/RVO/RVOCoreSimulator.cs
  4. +++ b/Assets/AstarPathfindingProject/Core/RVO/RVOCoreSimulator.cs
  5. @@ -782,13 +782,13 @@ namespace Pathfinding.RVO {
  6.                 deltaTime = DesiredDeltaTime;
  7.             }
  8.  
  9. -           if (Time.time - lastStep >= DesiredDeltaTime) {
  10. -               deltaTime = Time.time - lastStep;
  11. -               lastStep = Time.time;
  12. -
  13. -               // Prevent a zero delta time
  14. -               deltaTime = System.Math.Max(deltaTime, 1.0f/2000f);
  15. +           while(lastStep < Time.time) {
  16. +               Update(DesiredDeltaTime);
  17. +               lastStep += DesiredDeltaTime;
  18. +           }
  19. +       }
  20.  
  21. +       void Update(float deltaTime) {
  22.             if (Multithreading) {
  23.                 // Make sure the threads have completed their tasks
  24.                 // Otherwise block until they have
  25. @@ -864,7 +864,6 @@ namespace Pathfinding.RVO {
  26.                 for (int i = 0; i < agents.Count; i++) agents[i].PostCalculation();
  27.             }
  28.         }
  29. -       }
  30.  
  31.         internal class WorkerContext {
  32.             public Agent.VOBuffer vos = new Agent.VOBuffer(16);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement