Character controller working better

Moved ECS systems to separate folders
better raycast normal result
This commit is contained in:
Antoine Pilote
2021-06-18 16:44:54 -04:00
parent 8f238cd4ca
commit 5b56e2ff9a
73 changed files with 1179 additions and 489 deletions

View File

@@ -15,6 +15,8 @@
Ref<Project> Engine::CurrentProject;
Ref<Window> Engine::CurrentWindow;
float Engine::m_LastFrameTime = 0.0f;
float Engine::m_FixedUpdateRate = 1.0 / 60.0f;
float Engine::m_FixedUpdateDifference = 0.f;
bool Engine::IsPlayMode = false;
void Engine::Init()
@@ -46,11 +48,23 @@ void Engine::Tick()
m_LastFrameTime = time;
// Play mode update vs editor update.
if (Engine::IsPlayMode)
if (Engine::IsPlayMode) {
CurrentWindow->Update(timestep);
m_FixedUpdateDifference += timestep;
// Fixed update
if (m_FixedUpdateDifference >= m_FixedUpdateRate)
{
// call update here.
CurrentWindow->FixedUpdate(m_FixedUpdateRate);
m_FixedUpdateDifference = 0.f;
}
}
else
GetCurrentScene()->EditorUpdate(timestep);
Input::Update();
}