From a1b74aa2d5647006404c397381471fc772dfaaaf Mon Sep 17 00:00:00 2001 From: Sergey Lapin Date: Mon, 27 Apr 2026 05:37:41 +0300 Subject: [PATCH] Now Path Following component works --- .../editScene/systems/EditorUISystem.cpp | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/features/editScene/systems/EditorUISystem.cpp b/src/features/editScene/systems/EditorUISystem.cpp index 792428a..9528f6f 100644 --- a/src/features/editScene/systems/EditorUISystem.cpp +++ b/src/features/editScene/systems/EditorUISystem.cpp @@ -37,6 +37,8 @@ #include "../components/NavMesh.hpp" #include "../components/SmartObject.hpp" #include "../components/GoapPlanner.hpp" +#include "../components/GoapRunner.hpp" +#include "../components/PathFollowing.hpp" #include "../components/PrefabInstance.hpp" #include "../ui/TransformEditor.hpp" @@ -97,8 +99,8 @@ bool EditorUISystem::onMousePressed(const Ogre::Ray &mouseRay) return false; // Cursor place mode: raycast and place cursor on surface - if (m_cursorMode == CursorInteractionMode::Place && - m_physicsSystem && m_physicsSystem->isInitialized()) { + if (m_cursorMode == CursorInteractionMode::Place && m_physicsSystem && + m_physicsSystem->isInitialized()) { JoltPhysicsWrapper *physics = m_physicsSystem->getPhysicsWrapper(); if (physics) { @@ -119,16 +121,14 @@ bool EditorUISystem::onMousePressed(const Ogre::Ray &mouseRay) // Cursor translate/rotate: delegate to Cursor3D axis-based interaction if (m_cursorMode == CursorInteractionMode::Translate) { m_cursor3D->setMode(Cursor3D::Mode::Translate); - Ogre::Camera *cam = m_editorCamera ? - m_editorCamera->getCamera() : - nullptr; + Ogre::Camera *cam = + m_editorCamera ? m_editorCamera->getCamera() : nullptr; if (m_cursor3D->onMousePressed(mouseRay, cam)) return true; } else if (m_cursorMode == CursorInteractionMode::Rotate) { m_cursor3D->setMode(Cursor3D::Mode::Rotate); - Ogre::Camera *cam = m_editorCamera ? - m_editorCamera->getCamera() : - nullptr; + Ogre::Camera *cam = + m_editorCamera ? m_editorCamera->getCamera() : nullptr; if (m_cursor3D->onMousePressed(mouseRay, cam)) return true; } @@ -1044,7 +1044,22 @@ void EditorUISystem::renderComponentList(flecs::entity entity) // Render GoapPlanner if present if (entity.has()) { auto &planner = entity.get_mut(); - m_componentRegistry.render(entity, planner); + m_componentRegistry.render(entity, + planner); + componentCount++; + } + + // Render GoapRunner if present + if (entity.has()) { + auto &runner = entity.get_mut(); + m_componentRegistry.render(entity, runner); + componentCount++; + } + + // Render PathFollowing if present + if (entity.has()) { + auto &pf = entity.get_mut(); + m_componentRegistry.render(entity, pf); componentCount++; }