Merge pull request #1558 from DarkflameUniverse/swap-update-order

fix: out of order physics updates
This commit is contained in:
Gie "Max" Vanommeslaeghe 2024-05-01 22:33:45 +02:00 committed by GitHub
commit ab7f6f0b57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -388,14 +388,14 @@ int main(int argc, char** argv) {
//In world we'd update our other systems here.
if (zoneID != 0 && deltaTime > 0.0f) {
Metrics::StartMeasurement(MetricVariable::Physics);
dpWorld::StepWorld(deltaTime);
Metrics::EndMeasurement(MetricVariable::Physics);
Metrics::StartMeasurement(MetricVariable::UpdateEntities);
Game::entityManager->UpdateEntities(deltaTime);
Metrics::EndMeasurement(MetricVariable::UpdateEntities);
Metrics::StartMeasurement(MetricVariable::Physics);
dpWorld::StepWorld(deltaTime);
Metrics::EndMeasurement(MetricVariable::Physics);
Metrics::StartMeasurement(MetricVariable::Ghosting);
if (std::chrono::duration<float>(currentTime - ghostingLastTime).count() >= 1.0f) {
Game::entityManager->UpdateGhosting();