diff --git a/DynamicsB2World.go b/DynamicsB2World.go index f349a3b..5d6e17a 100644 --- a/DynamicsB2World.go +++ b/DynamicsB2World.go @@ -912,13 +912,6 @@ func (world *B2World) Step(dt float64, velocityIterations int, positionIteration step.WarmStarting = world.M_warmStarting - // Update contacts. This is where some contacts are destroyed. - { - timer := MakeB2Timer() - world.M_contactManager.Collide() - world.M_profile.Collide = timer.GetMilliseconds() - } - // Integrate velocities, solve velocity constraints, and integrate positions. if world.M_stepComplete && step.Dt > 0.0 { timer := MakeB2Timer() @@ -926,6 +919,13 @@ func (world *B2World) Step(dt float64, velocityIterations int, positionIteration world.M_profile.Solve = timer.GetMilliseconds() } + // Update contacts. This is where some contacts are destroyed. + { + timer := MakeB2Timer() + world.M_contactManager.Collide() + world.M_profile.Collide = timer.GetMilliseconds() + } + // Handle TOI events. if world.M_continuousPhysics && step.Dt > 0.0 { timer := MakeB2Timer()