mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Now storing recast config in component
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <src/Scene/Entities/ImGuiHelper.h>
|
||||
#include <src/Scene/Components/NavMeshVolumeComponent.h>
|
||||
#include <src/Core/Maths.h>
|
||||
#include <src/AI/RecastConfig.h>
|
||||
|
||||
class NavMeshVolumePanel : ComponentPanel {
|
||||
|
||||
@@ -94,7 +95,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
NavManager::Get().BuildNavMesh();
|
||||
NavManager::Get().BuildNavMesh(RecastConfig(component));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "src/Scene/Systems/QuakeMapBuilder.h"
|
||||
#include <src/Core/FileSystem.h>
|
||||
#include <src/AI/NavManager.h>
|
||||
|
||||
#include <src/UI/ImUI.h>
|
||||
|
||||
class QuakeMapPanel : ComponentPanel {
|
||||
|
||||
@@ -13,6 +13,8 @@ public:
|
||||
|
||||
void Draw(Nuake::Entity entity) override
|
||||
{
|
||||
using namespace Nuake;
|
||||
|
||||
if (!entity.HasComponent<Nuake::QuakeMapComponent>())
|
||||
return;
|
||||
|
||||
@@ -65,41 +67,11 @@ public:
|
||||
ImGui::Text("Build");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
if (ImGui::Button("Build"))
|
||||
if (UI::SecondaryButton("Build Geometry"))
|
||||
{
|
||||
Nuake::QuakeMapBuilder builder;
|
||||
builder.BuildQuakeMap(entity, component.HasCollisions);
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
//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