Use vectors to store offmesh connection data rather than arrays

This commit is contained in:
Graham Pentheny
2025-08-25 12:08:48 -04:00
parent 30d459ca73
commit 8de2dcef5f
6 changed files with 86 additions and 88 deletions

View File

@@ -70,8 +70,8 @@ void OffMeshConnectionTool::onClick(const float* /*rayStartPos*/, const float* r
// Find nearest link end-point
float nearestDist = FLT_MAX;
int nearestIndex = -1;
const float* verts = geom->offMeshConVerts;
for (int i = 0; i < geom->offMeshConCount * 2; ++i)
const std::vector<float> verts = geom->offmeshConnVerts;
for (int i = 0; i < static_cast<int>(geom->offmeshConnId.size()) * 2; ++i)
{
const float distance = rcVdistSqr(rayHitPos, &verts[i * 3]);
if (distance < nearestDist)