mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Now only drawing navmesh if selected + properly serialized
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <src/Scene/Components/ParticleEmitterComponent.h>
|
||||
#include <src/Scene/Components/BoneComponent.h>
|
||||
#include <src/Scene/Components/AudioEmitterComponent.h>
|
||||
#include <DetourDebugDraw.h>
|
||||
|
||||
|
||||
GizmoDrawer::GizmoDrawer(EditorInterface* editor)
|
||||
@@ -175,6 +176,23 @@ void GizmoDrawer::DrawAxis(Ref<Scene> scene, bool occluded)
|
||||
}
|
||||
}
|
||||
|
||||
void GizmoDrawer::DrawNavMesh(Ref<Scene> scene, bool occluded)
|
||||
{
|
||||
auto cam = Engine::GetCurrentScene()->m_EditorCamera;
|
||||
|
||||
auto navVolumesView = scene->m_Registry.view<TransformComponent, NavMeshVolumeComponent>();
|
||||
for (auto e : navVolumesView)
|
||||
{
|
||||
if (!IsEntityInSelection(Nuake::Entity{ (entt::entity)e, scene.get() }))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
auto [transform, navmesh] = scene->m_Registry.get<TransformComponent, NavMeshVolumeComponent>(e);
|
||||
duDebugDrawNavMesh(&m_DebugDrawer, *navmesh.NavMeshData->GetNavMesh(), DU_DRAWNAVMESH_OFFMESHCONS);
|
||||
}
|
||||
}
|
||||
|
||||
void GizmoDrawer::DrawGizmos(Ref<Scene> scene, bool occluded)
|
||||
{
|
||||
using namespace Nuake;
|
||||
|
||||
Reference in New Issue
Block a user