mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Smoother physics
This commit is contained in:
@@ -32,19 +32,6 @@ namespace Nuake
|
||||
InitializeCharacterControllers();
|
||||
InitializeQuakeMap();
|
||||
|
||||
// TODO: Triggers
|
||||
|
||||
//auto bspTriggerView = m_Scene->m_Registry.view<TransformComponent, BSPBrushComponent, TriggerZone>();
|
||||
//for (auto e : bspTriggerView)
|
||||
//{
|
||||
// auto [transform, brush, trigger] = bspTriggerView.get<TransformComponent, BSPBrushComponent, TriggerZone>(e);
|
||||
|
||||
// Ref<Physics::MeshShape> meshShape = CreateRef<Physics::MeshShape>(brush.Meshes[0]);
|
||||
// Ref<GhostObject> ghostBody = CreateRef<GhostObject>(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<TransformComponent, BSPBrushComponent>();
|
||||
for (auto e : brushes)
|
||||
{
|
||||
@@ -121,9 +112,7 @@ namespace Nuake
|
||||
return;
|
||||
|
||||
InitializeRigidbodies();
|
||||
ApplyForces();
|
||||
|
||||
PhysicsManager::Get().Step(ts);
|
||||
|
||||
}
|
||||
|
||||
void PhysicsSystem::Exit()
|
||||
|
||||
Reference in New Issue
Block a user