From a3d652c5e360c4a55c145f641d5ac75a3ecc93a1 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Wed, 24 Jul 2024 23:59:17 -0400 Subject: [PATCH] Added bound to recast config --- Nuake/src/AI/NavManager.cpp | 4 ++-- Nuake/src/AI/RecastConfig.cpp | 1 + Nuake/src/AI/RecastConfig.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Nuake/src/AI/NavManager.cpp b/Nuake/src/AI/NavManager.cpp index 3a0e0229..d5d04b80 100644 --- a/Nuake/src/AI/NavManager.cpp +++ b/Nuake/src/AI/NavManager.cpp @@ -58,8 +58,8 @@ namespace Nuake { currentVertexOffset = std::size(vertices); } - float bmin[3] = { -100.0f, -100.0f, -100.0f }; - float bmax[3] = { 100.0f, 100.0f, 100.0f }; + float bmin[3] = { -config.Bound.x, -config.Bound.y, -config.Bound.z }; + float bmax[3] = { config.Bound.x, config.Bound.y, config.Bound.z }; rcConfig recastConfig; recastConfig.cs = config.CellSize; recastConfig.ch = config.CellHeight; diff --git a/Nuake/src/AI/RecastConfig.cpp b/Nuake/src/AI/RecastConfig.cpp index ffdd0da2..f97f073f 100644 --- a/Nuake/src/AI/RecastConfig.cpp +++ b/Nuake/src/AI/RecastConfig.cpp @@ -6,6 +6,7 @@ namespace Nuake { RecastConfig::RecastConfig(const NavMeshVolumeComponent& component) { + Bound = component.VolumeSize; CellSize = component.CellSize; CellHeight = component.CellHeight; TileSize = component.TileSize; diff --git a/Nuake/src/AI/RecastConfig.h b/Nuake/src/AI/RecastConfig.h index 793de94c..1be023b3 100644 --- a/Nuake/src/AI/RecastConfig.h +++ b/Nuake/src/AI/RecastConfig.h @@ -1,4 +1,5 @@ #pragma once +#include "src/Core/Maths.h" namespace Nuake { @@ -7,6 +8,7 @@ namespace Nuake { class RecastConfig { public: + Vector3 Bound = Vector3(100, 100, 100); float CellSize = 0.2f; float CellHeight = 0.2f; float TileSize = 10.0f;