Let physics run for a while to prevent bugs
This commit is contained in:
4
Game.cpp
4
Game.cpp
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user