diff --git a/RecastDemo/Include/InputGeom.h b/RecastDemo/Include/InputGeom.h index 3b661424..13cf430a 100644 --- a/RecastDemo/Include/InputGeom.h +++ b/RecastDemo/Include/InputGeom.h @@ -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; } diff --git a/RecastDemo/Source/OffMeshConnectionTool.cpp b/RecastDemo/Source/OffMeshConnectionTool.cpp index 918baa11..ec4967fe 100644 --- a/RecastDemo/Source/OffMeshConnectionTool.cpp +++ b/RecastDemo/Source/OffMeshConnectionTool.cpp @@ -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) diff --git a/RecastDemo/Source/Sample_SoloMesh.cpp b/RecastDemo/Source/Sample_SoloMesh.cpp index 11be9d76..cec0fb2f 100644 --- a/RecastDemo/Source/Sample_SoloMesh.cpp +++ b/RecastDemo/Source/Sample_SoloMesh.cpp @@ -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; diff --git a/RecastDemo/Source/Sample_TempObstacles.cpp b/RecastDemo/Source/Sample_TempObstacles.cpp index 2fb9c378..ae02dd37 100644 --- a/RecastDemo/Source/Sample_TempObstacles.cpp +++ b/RecastDemo/Source/Sample_TempObstacles.cpp @@ -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; } } }; diff --git a/RecastDemo/Source/Sample_TileMesh.cpp b/RecastDemo/Source/Sample_TileMesh.cpp index e3474881..b9288db0 100644 --- a/RecastDemo/Source/Sample_TileMesh.cpp +++ b/RecastDemo/Source/Sample_TileMesh.cpp @@ -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;