From 9fe86c18eef182f882775cd05a90db2174ced0d1 Mon Sep 17 00:00:00 2001 From: RaphaelIT7 Date: Mon, 2 Oct 2023 00:32:19 +0200 Subject: [PATCH] Fixed IsInSimulation() is being set too early Related issue: fixes #102 --- vphysics_jolt/vjolt_environment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vphysics_jolt/vjolt_environment.cpp b/vphysics_jolt/vjolt_environment.cpp index 34baf4b..d6cda43 100644 --- a/vphysics_jolt/vjolt_environment.cpp +++ b/vphysics_jolt/vjolt_environment.cpp @@ -765,12 +765,12 @@ void JoltPhysicsEnvironment::Simulate( float deltaTime ) HandleDebugDumpingEnvironment( VJOLT_RETURN_ADDRESS() ); - m_bSimulating = true; - // Funnily enough, VPhysics calls this BEFORE // doing the simulation... m_ContactListener.PostSimulationFrame(); + m_bSimulating = true; + // Run pre-simulation controllers for ( IJoltPhysicsController *pController : m_pPhysicsControllers ) pController->OnPreSimulate( deltaTime );