From 88b2cc5c294850576e42b4a7f690f6546fffd31c Mon Sep 17 00:00:00 2001 From: SR Date: Sat, 15 Feb 2020 20:00:16 +0300 Subject: [PATCH] Fix one frame delay --- DynamicsB2World.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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()