Recast: rename shape volume methods

Reflect new changes, which supports more than only convex shapes.
This commit is contained in:
Kawe Mazidjatari 2024-09-23 12:19:49 +02:00
parent fa1db8f995
commit 0298591068
3 changed files with 7 additions and 7 deletions

View File

@ -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];

View File

@ -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;

View File

@ -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);