From 0298591068fb2272e19ed7270e9deac41bd85a2c Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:19:49 +0200 Subject: [PATCH] Recast: rename shape volume methods Reflect new changes, which supports more than only convex shapes. --- src/naveditor/InputGeom.cpp | 2 +- src/naveditor/ShapeVolumeTool.cpp | 6 +++--- src/naveditor/include/InputGeom.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/naveditor/InputGeom.cpp b/src/naveditor/InputGeom.cpp index 8545fbce..ac492d9a 100644 --- a/src/naveditor/InputGeom.cpp +++ b/src/naveditor/InputGeom.cpp @@ -779,7 +779,7 @@ int InputGeom::addConvexVolume(const float* verts, const int nverts, return m_volumeCount-1; } -void InputGeom::deleteConvexVolume(int i) +void InputGeom::deleteShapeVolume(int i) { m_volumeCount--; m_volumes[i] = m_volumes[m_volumeCount]; diff --git a/src/naveditor/ShapeVolumeTool.cpp b/src/naveditor/ShapeVolumeTool.cpp index 6aec27eb..d0dbf2c2 100644 --- a/src/naveditor/ShapeVolumeTool.cpp +++ b/src/naveditor/ShapeVolumeTool.cpp @@ -78,7 +78,7 @@ static int convexhull(const float* pts, int npts, int* out) static bool isValidVolumeIndex(const int index, const InputGeom* geom) { - return index > -1 && index < geom->getConvexVolumeCount(); + return index > -1 && index < geom->getShapeVolumeCount(); } void handleVolumeFlags(int& flags, const char* buttonId) @@ -233,7 +233,7 @@ void ShapeVolumeTool::handleMenu() ImGui::Separator(); ImGui::Text("Modify Shape"); - ShapeVolume& vol = geom->getConvexVolumes()[m_selectedVolumeIndex]; + ShapeVolume& vol = geom->getShapeVolumes()[m_selectedVolumeIndex]; if (m_selectedVolumeIndex != m_copiedShapeIndex) { @@ -330,7 +330,7 @@ void ShapeVolumeTool::handleMenu() if (ImGui::Button("Delete Shape##ShapeVolumeModify")) { - geom->deleteConvexVolume(m_selectedVolumeIndex); + geom->deleteShapeVolume(m_selectedVolumeIndex); m_selectedVolumeIndex = -1; return; diff --git a/src/naveditor/include/InputGeom.h b/src/naveditor/include/InputGeom.h index d2ae1eb1..3a1d6f01 100644 --- a/src/naveditor/include/InputGeom.h +++ b/src/naveditor/include/InputGeom.h @@ -189,15 +189,15 @@ public: /// @name Shape Volumes. ///@{ - int getConvexVolumeCount() const { return m_volumeCount; } // todo(amos): rename to 'getShapeVolumeCount' - ShapeVolume* getConvexVolumes() { return m_volumes; } // todo(amos): rename to 'getShapeVolumes' + int getShapeVolumeCount() const { return m_volumeCount; } // todo(amos): rename to 'getShapeVolumeCount' + ShapeVolume* getShapeVolumes() { return m_volumes; } // todo(amos): rename to 'getShapeVolumes' int addBoxVolume(const float* bmin, const float* bmax, unsigned short flags, unsigned char area); int addCylinderVolume(const float* pos, const float radius, const float height, unsigned short flags, unsigned char area); int addConvexVolume(const float* verts, const int nverts, const float minh, const float maxh, unsigned short flags, unsigned char area); - void deleteConvexVolume(int i); // todo(amos): rename to 'deleteShapeVolumes' + void deleteShapeVolume(int i); void drawBoxVolumes(struct duDebugDraw* dd, const float* offset, const int hilightIdx = -1); void drawCylinderVolumes(struct duDebugDraw* dd, const float* offset, const int hilightIdx = -1); void drawConvexVolumes(struct duDebugDraw* dd, const float* offset, const int hilightIdx = -1);