From 33e04e92168246a24a111ca8e76d47fd4aeb14a4 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Tue, 5 Sep 2023 20:28:18 -0400 Subject: [PATCH] Smoother physics --- Nuake/src/Scene/Systems/PhysicsSystem.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/Nuake/src/Scene/Systems/PhysicsSystem.cpp b/Nuake/src/Scene/Systems/PhysicsSystem.cpp index e324500b..dba4dcf4 100644 --- a/Nuake/src/Scene/Systems/PhysicsSystem.cpp +++ b/Nuake/src/Scene/Systems/PhysicsSystem.cpp @@ -32,19 +32,6 @@ namespace Nuake InitializeCharacterControllers(); InitializeQuakeMap(); - // TODO: Triggers - - //auto bspTriggerView = m_Scene->m_Registry.view(); - //for (auto e : bspTriggerView) - //{ - // auto [transform, brush, trigger] = bspTriggerView.get(e); - - // Ref meshShape = CreateRef(brush.Meshes[0]); - // Ref ghostBody = CreateRef(transform.GetGlobalPosition(), meshShape); - // trigger.GhostObject = ghostBody; - - // PhysicsManager::Get()->RegisterGhostBody(ghostBody); - //} Logger::Log("Physic system initialized successfully"); return true; } @@ -56,6 +43,10 @@ namespace Nuake return; } + ApplyForces(); + + PhysicsManager::Get().Step(ts); + auto brushes = m_Scene->m_Registry.view(); for (auto e : brushes) { @@ -121,9 +112,7 @@ namespace Nuake return; InitializeRigidbodies(); - ApplyForces(); - - PhysicsManager::Get().Step(ts); + } void PhysicsSystem::Exit()