Making this work

This commit is contained in:
2025-08-21 10:47:57 +03:00
parent 52de5b16a8
commit d3b2ae30d5
9 changed files with 147 additions and 46 deletions

View File

@@ -22,6 +22,7 @@ Character::Character(Ogre::SceneManager *scnMgr, const Ogre::String &model,
, mGhostObject(nullptr)
, mWorld(world)
, mGoalDirection(0, 0, 0)
, mUpdate(false)
{
setupBody();
setupAnimations();
@@ -38,10 +39,12 @@ bool Character::frameStarted(const Ogre::FrameEvent &evt)
bool Character::frameRenderingQueued(const Ogre::FrameEvent &evt)
{
updateBody(evt.timeSinceLastFrame);
updateAnimations(evt.timeSinceLastFrame);
if (evt.timeSinceLastFrame > 0)
updateRootMotion(evt.timeSinceLastFrame);
if (mUpdate) {
updateBody(evt.timeSinceLastFrame);
updateAnimations(evt.timeSinceLastFrame);
if (evt.timeSinceLastFrame > 0)
updateRootMotion(evt.timeSinceLastFrame);
}
return true;
}