Removed unnecessary accessor for offMeshConCount

This commit is contained in:
Graham Pentheny
2025-08-05 16:00:21 -04:00
parent c403a39cb0
commit a1f2d3df09
5 changed files with 6 additions and 5 deletions

View File

@@ -91,6 +91,7 @@ private:
BuildSettings buildSettings;
bool hasBuildSettings = false;
public:
/// @name Off-Mesh connections.
///@{
static constexpr int MAX_OFFMESH_CONNECTIONS = 256;
@@ -103,6 +104,7 @@ private:
int offMeshConCount = 0;
///@}
private:
/// @name Convex Volumes.
///@{
static const int MAX_VOLUMES = 256;
@@ -136,7 +138,6 @@ public:
/// @name Off-Mesh connections.
///@{
[[nodiscard]] int getOffMeshConnectionCount() const { return offMeshConCount; }
[[nodiscard]] const float* getOffMeshConnectionVerts() const { return offMeshConVerts; }
[[nodiscard]] const float* getOffMeshConnectionRads() const { return offMeshConRads; }
[[nodiscard]] const unsigned char* getOffMeshConnectionDirs() const { return offMeshConDirs; }

View File

@@ -86,7 +86,7 @@ void OffMeshConnectionTool::handleClick(const float* /*rayStartPos*/, const floa
float nearestDist = FLT_MAX;
int nearestIndex = -1;
const float* verts = geom->getOffMeshConnectionVerts();
for (int i = 0; i < geom->getOffMeshConnectionCount() * 2; ++i)
for (int i = 0; i < geom->offMeshConCount * 2; ++i)
{
float dist = rcVdistSqr(rayHitPos, &verts[i * 3]);
if (dist < nearestDist)

View File

@@ -713,7 +713,7 @@ bool Sample_SoloMesh::build()
params.offMeshConAreas = inputGeometry->getOffMeshConnectionAreas();
params.offMeshConFlags = inputGeometry->getOffMeshConnectionFlags();
params.offMeshConUserID = inputGeometry->getOffMeshConnectionId();
params.offMeshConCount = inputGeometry->getOffMeshConnectionCount();
params.offMeshConCount = inputGeometry->offMeshConCount;
params.walkableHeight = agentHeight;
params.walkableRadius = agentRadius;
params.walkableClimb = agentMaxClimb;

View File

@@ -490,7 +490,7 @@ struct MeshProcess : dtTileCacheMeshProcess
params->offMeshConAreas = inputGeometry->getOffMeshConnectionAreas();
params->offMeshConFlags = inputGeometry->getOffMeshConnectionFlags();
params->offMeshConUserID = inputGeometry->getOffMeshConnectionId();
params->offMeshConCount = inputGeometry->getOffMeshConnectionCount();
params->offMeshConCount = inputGeometry->offMeshConCount;
}
}
};

View File

@@ -1213,7 +1213,7 @@ unsigned char* Sample_TileMesh::buildTileMesh(
params.offMeshConAreas = inputGeometry->getOffMeshConnectionAreas();
params.offMeshConFlags = inputGeometry->getOffMeshConnectionFlags();
params.offMeshConUserID = inputGeometry->getOffMeshConnectionId();
params.offMeshConCount = inputGeometry->getOffMeshConnectionCount();
params.offMeshConCount = inputGeometry->offMeshConCount;
params.walkableHeight = agentHeight;
params.walkableRadius = agentRadius;
params.walkableClimb = agentMaxClimb;