Major Update - Physique Fixed Update And Thread
Physics process run in a fixed update in a thread
This commit is contained in:
@@ -144,9 +144,6 @@ void SystemClass::Run()
|
||||
// Loop until there is a quit message from the window or the user.
|
||||
done = false;
|
||||
|
||||
auto fixedUpdateInterval = std::chrono::milliseconds(16);
|
||||
auto m_lastFixedUpdateTime = std::chrono::steady_clock::now();
|
||||
|
||||
while (!done)
|
||||
{
|
||||
// Handle the windows messages.
|
||||
@@ -178,13 +175,6 @@ void SystemClass::Run()
|
||||
Logger::Get().Log("Failed to process frame", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
done = true;
|
||||
}
|
||||
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
if (now - m_lastFixedUpdateTime >= fixedUpdateInterval)
|
||||
{
|
||||
FixedUpdate();
|
||||
m_lastFixedUpdateTime = now;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -476,9 +466,4 @@ void SystemClass::SendPath(wchar_t* path, std::filesystem::path WFolder)
|
||||
{
|
||||
m_Application->SetPath(path);
|
||||
m_Application->SetWFolder(WFolder);
|
||||
}
|
||||
|
||||
void SystemClass::FixedUpdate()
|
||||
{
|
||||
m_Application->GetPhysics()->Update();
|
||||
}
|
||||
Reference in New Issue
Block a user