Let physics run for a while to prevent bugs

This commit is contained in:
2025-09-08 11:40:53 +03:00
parent 3f59a384e4
commit 4d0fb8f60f
4 changed files with 35 additions and 24 deletions

View File

@@ -185,6 +185,7 @@ class App : public OgreBites::ApplicationContext {
ECS::Vector2 mouse{ 0, 0 };
float wheel_y;
bool mouse_moved = false, wheel_moved = false;
float mInitDelay;
public:
Ogre::Timer fps_timer;
@@ -195,6 +196,7 @@ class App : public OgreBites::ApplicationContext {
, mApp(app)
, fast(false)
, control(0)
, mInitDelay(1.0)
{
}
bool isGuiEnabled()
@@ -322,6 +324,8 @@ class App : public OgreBites::ApplicationContext {
}
if (!isGuiEnabled()) {
mApp->updateWorld(evt.timeSinceLastFrame);
if (mInitDelay >= 0.0f)
mInitDelay -= evt.timeSinceLastFrame;
}
if (!isGuiEnabled() && ECS::get().has<ECS::Input>()) {
ECS::Input &input =