Lots of updates - lua, narrator, logic, models

This commit is contained in:
2025-09-19 04:35:20 +03:00
parent 4249a0238b
commit 62e14cf075
19 changed files with 924 additions and 157 deletions

View File

@@ -282,10 +282,6 @@ public:
control &= ~256;
return false;
}
void update(float delta)
{
return;
}
void frameRendered(const Ogre::FrameEvent &evt) override;
};
class App : public OgreBites::ApplicationContext {
@@ -432,18 +428,22 @@ public:
}
void updateWorld(float delta)
{
mDynWorld->getBtWorld()->stepSimulation(delta, 4);
mDynWorld->getBtWorld()->stepSimulation(delta, 3);
if (!ECS::get().has<ECS::GUI>())
return;
/* Update window grab */
if (ECS::get().has<ECS::GUI>() &&
ECS::get().get<ECS::GUI>().grabChanged) {
setWindowGrab(ECS::get().get<ECS::GUI>().grab);
ECS::get().get_mut<ECS::GUI>().grabChanged = false;
ECS::GUI &gui = ECS::get().get_mut<ECS::GUI>();
if (gui.grabChanged) {
setWindowGrab(gui.grab);
gui.grabChanged = false;
ECS::get().modified<ECS::GUI>();
}
ECS::update(delta);
/*
if (enabldDbgDraw)
mDbgDraw->update();
*/
}
class InputListenerChainFlexible : public OgreBites::InputListener {
protected:
@@ -761,7 +761,6 @@ void KeyboardListener::frameRendered(const Ogre::FrameEvent &evt)
<< "\n";
fps_timer.reset();
}
update(evt.timeSinceLastFrame);
if (!isGuiEnabled() ||
(isGuiEnabled() && ECS::get<ECS::GUI>().narrationBox)) {
mApp->updateWorld(evt.timeSinceLastFrame);