From 26dbdef50da61c146a67b79d2f9d04fef80bbeb0 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Thu, 7 Dec 2023 16:45:46 +0100 Subject: [PATCH] JoltPhysics3D: Add elapsedTime parameter to PostSimulate --- include/Nazara/JoltPhysics3D/JoltCharacter.hpp | 4 ++-- include/Nazara/JoltPhysics3D/JoltPhysicsStepListener.hpp | 2 +- src/Nazara/JoltPhysics3D/JoltCharacter.cpp | 6 +++--- src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp | 2 +- src/Nazara/JoltPhysics3D/JoltPhysicsStepListener.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/Nazara/JoltPhysics3D/JoltCharacter.hpp b/include/Nazara/JoltPhysics3D/JoltCharacter.hpp index d05a7b4ef..7c03bf62b 100644 --- a/include/Nazara/JoltPhysics3D/JoltCharacter.hpp +++ b/include/Nazara/JoltPhysics3D/JoltCharacter.hpp @@ -82,7 +82,7 @@ namespace Nz void Destroy(); private: - void PostSimulate() override; + void PostSimulate(float elapsedTime) override; void PreSimulate(float elapsedTime) override; std::shared_ptr m_impl; @@ -100,7 +100,7 @@ namespace Nz JoltCharacterImpl(JoltCharacterImpl&&) = delete; virtual ~JoltCharacterImpl(); - virtual void PostSimulate(JoltCharacter& character); + virtual void PostSimulate(JoltCharacter& character, float elapsedTime); virtual void PreSimulate(JoltCharacter& character, float elapsedTime); JoltCharacterImpl& operator=(const JoltCharacterImpl&) = delete; diff --git a/include/Nazara/JoltPhysics3D/JoltPhysicsStepListener.hpp b/include/Nazara/JoltPhysics3D/JoltPhysicsStepListener.hpp index 0675b1b59..4b453ebf1 100644 --- a/include/Nazara/JoltPhysics3D/JoltPhysicsStepListener.hpp +++ b/include/Nazara/JoltPhysics3D/JoltPhysicsStepListener.hpp @@ -20,7 +20,7 @@ namespace Nz JoltPhysicsStepListener(JoltPhysicsStepListener&&) = delete; virtual ~JoltPhysicsStepListener(); - virtual void PostSimulate(); + virtual void PostSimulate(float elapsedTime); virtual void PreSimulate(float elapsedTime); JoltPhysicsStepListener& operator=(const JoltPhysicsStepListener&) = delete; diff --git a/src/Nazara/JoltPhysics3D/JoltCharacter.cpp b/src/Nazara/JoltPhysics3D/JoltCharacter.cpp index 5d28b0a7b..be63d0dca 100644 --- a/src/Nazara/JoltPhysics3D/JoltCharacter.cpp +++ b/src/Nazara/JoltPhysics3D/JoltCharacter.cpp @@ -197,10 +197,10 @@ namespace Nz m_collider.reset(); } - void JoltCharacter::PostSimulate() + void JoltCharacter::PostSimulate(float elapsedTime) { m_character->PostSimulation(0.05f); - m_impl->PostSimulate(*this); + m_impl->PostSimulate(*this, elapsedTime); } void JoltCharacter::PreSimulate(float elapsedTime) @@ -211,7 +211,7 @@ namespace Nz JoltCharacterImpl::~JoltCharacterImpl() = default; - void JoltCharacterImpl::PostSimulate(JoltCharacter& /*character*/) + void JoltCharacterImpl::PostSimulate(JoltCharacter& /*character*/, float /*elapsedTime*/) { } diff --git a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp index ad359c7e6..36957df30 100644 --- a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp +++ b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp @@ -473,7 +473,7 @@ namespace Nz m_world->physicsSystem.Update(stepSize, 1, &m_world->tempAllocator, &jobSystem); for (JoltPhysicsStepListener* stepListener : m_stepListeners) - stepListener->PostSimulate(); + stepListener->PostSimulate(stepSize); m_timestepAccumulator -= m_stepSize; stepCount++; diff --git a/src/Nazara/JoltPhysics3D/JoltPhysicsStepListener.cpp b/src/Nazara/JoltPhysics3D/JoltPhysicsStepListener.cpp index 6436fd5bd..acf591aba 100644 --- a/src/Nazara/JoltPhysics3D/JoltPhysicsStepListener.cpp +++ b/src/Nazara/JoltPhysics3D/JoltPhysicsStepListener.cpp @@ -9,7 +9,7 @@ namespace Nz { JoltPhysicsStepListener::~JoltPhysicsStepListener() = default; - void JoltPhysicsStepListener::PostSimulate() + void JoltPhysicsStepListener::PostSimulate(float /*elapsedTime*/) { }