Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
fix substepping
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed Oct 18, 2017
1 parent e0c06cb commit 7c5550b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Physics2D/Dynamics/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ public partial class World
private const bool _subStepping = false;
#endregion

private bool _stepComplete = true;

private float _invDt0;
private Body[] _stack = new Body[64];
private bool _stepComplete;
private HashSet<Body> _bodyAddList = new HashSet<Body>();
private HashSet<Body> _bodyRemoveList = new HashSet<Body>();
private HashSet<Joint> _jointAddList = new HashSet<Joint>();
Expand Down Expand Up @@ -1381,7 +1382,7 @@ public void Step(float dt)
ContactsUpdateTime = TimeSpan.FromTicks(_watch.ElapsedTicks) - (AddRemoveTime + NewContactsTime + ControllersUpdateTime);

// Integrate velocities, solve velocity constraints, and integrate positions.
if (step.dt > 0.0f)
if (_stepComplete && step.dt > 0.0f)
{
Solve(ref step);
}
Expand Down

0 comments on commit 7c5550b

Please sign in to comment.