Now taking into account navmesh volume position

This commit is contained in:
Antoine Pilote
2024-07-25 20:42:32 -04:00
parent a3d652c5e3
commit 32ede2eeae
3 changed files with 6 additions and 3 deletions

View File

@@ -368,7 +368,9 @@ public:
}
}
NavManager::Get().BuildNavMesh(RecastConfig(component));
auto recastConfig = RecastConfig(component);
recastConfig.Position = volumeTransformComponent.GetGlobalPosition();
NavManager::Get().BuildNavMesh(std::move(recastConfig));
}
}
}

View File

@@ -58,8 +58,8 @@ namespace Nuake {
currentVertexOffset = std::size(vertices);
}
float bmin[3] = { -config.Bound.x, -config.Bound.y, -config.Bound.z };
float bmax[3] = { config.Bound.x, config.Bound.y, config.Bound.z };
float bmin[3] = { config.Position.x - config.Bound.x, config.Position.y - config.Bound.y, config.Position.z - config.Bound.z };
float bmax[3] = { config.Position.x + config.Bound.x, config.Position.y + config.Bound.y, config.Position.z + config.Bound.z };
rcConfig recastConfig;
recastConfig.cs = config.CellSize;
recastConfig.ch = config.CellHeight;

View File

@@ -8,6 +8,7 @@ namespace Nuake {
class RecastConfig
{
public:
Vector3 Position = { 0, 0, 0 };
Vector3 Bound = Vector3(100, 100, 100);
float CellSize = 0.2f;
float CellHeight = 0.2f;