Skip to content

Commit

Permalink
GImpactCollisionShape: add countSubmeshes() and getSubmesh() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Mar 19, 2024
1 parent aea3f54 commit 9a8b140
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,31 @@ public int countMeshVertices() {
return numVertices;
}

/**
* Count how many submeshes are in the mesh.
*
* @return the count (≥0)
*/
public int countSubmeshes() {
int result = nativeMesh.countSubmeshes();
return result;
}

/**
* Access the specified submesh.
*
* @param index the index of the desired submesh (in the order the submeshes
* were added, ≥0)
* @return the pre-existing instance (not null)
*/
public IndexedMesh getSubmesh(int index) {
int numSubmeshes = nativeMesh.countSubmeshes();
Validate.inRange(index, "submesh index", 0, numSubmeshes - 1);

IndexedMesh result = nativeMesh.getSubmesh(index);
return result;
}

/**
* Attempt to divide this shape into 2 shapes.
*
Expand Down

0 comments on commit 9a8b140

Please sign in to comment.