mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Added Recast&Detour implementation
- Implemented debug renderer of navigation meshes - Can now generate navigation meshes from .map files
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <src/Scene/Components/QuakeMap.h>
|
||||
#include "src/Scene/Systems/QuakeMapBuilder.h"
|
||||
#include <src/Core/FileSystem.h>
|
||||
#include <src/AI/NavManager.h>
|
||||
|
||||
|
||||
class QuakeMapPanel : ComponentPanel {
|
||||
@@ -74,6 +75,32 @@ public:
|
||||
|
||||
//ComponentTableReset(component.Class, "");
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
using namespace Nuake;
|
||||
|
||||
ImGui::Text("Build Navigation Mesh");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
if (ImGui::Button("Build Navigation"))
|
||||
{
|
||||
for (auto& mesh : component.m_Brushes)
|
||||
{
|
||||
if (mesh.HasComponent<ModelComponent>())\
|
||||
{
|
||||
TransformComponent& transformComponent = mesh.GetComponent<TransformComponent>();
|
||||
for (auto& mesh : mesh.GetComponent<ModelComponent>().ModelResource->GetMeshes())
|
||||
{
|
||||
Nuake::NavManager::Get().PushMesh(mesh, transformComponent.GetGlobalTransform());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Nuake::NavManager::Get().BuildNavMesh();
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
}
|
||||
EndComponentTable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user