Package com.github.stephengold.joltjni
Class ConvexHullShape
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Shape
com.github.stephengold.joltjni.ConvexShape
com.github.stephengold.joltjni.ConvexHullShape
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstShape,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
A
Shape to represent a convex hull defined by a collection of
vertices.-
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the convex radius.intgetFaceVertices(int faceIndex, int[] storeIndices) Enumerate the vertices in the specified face.intgetFaceVertices(int faceIndex, int maxVertices, int[] storeIndices) Enumerate the vertices in the specified face.intCount the faces in the convex hull.intCount the vertices of the convex hull.intgetNumVerticesInFace(int faceIndex) Count the vertices in the specified face.getPoint(int pointIndex) Locate the specified vertex of the convex hull relative to its center of mass.Methods inherited from class com.github.stephengold.joltjni.Shape
copyDebugTriangles, countDebugTriangles, draw, getCenterOfMass, getInnerRadius, getLocalBounds, getMassProperties, getRefCount, getSubType, getType, getUserData, getWorldSpaceBounds, mustBeStatic, setEmbedded, setUserData, toRef, toRefCMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, va
-
Method Details
-
getConvexRadius
public float getConvexRadius()Return the convex radius. The shape is unaffected.- Returns:
- the radius (≥0)
-
getFaceVertices
public int getFaceVertices(int faceIndex, int[] storeIndices) Enumerate the vertices in the specified face. The shape is unaffected.- Parameters:
faceIndex- the index of the face to query (≥0, <numFaces)storeIndices- storage for the result (not null, modified)- Returns:
- the number of vertices in the face
-
getFaceVertices
public int getFaceVertices(int faceIndex, int maxVertices, int[] storeIndices) Enumerate the vertices in the specified face. The shape is unaffected.- Parameters:
faceIndex- the index of the face to query (≥0, <numFaces)maxVertices- the maximum number of vertices to return (≥0, default=storeIndices.length)storeIndices- storage for the result (not null, length≥maxVertices, modified)- Returns:
- the number of vertices in the face (≥0)
-
getNumFaces
public int getNumFaces()Count the faces in the convex hull. The shape is unaffected.- Returns:
- the count (≥0)
-
getNumPoints
public int getNumPoints()Count the vertices of the convex hull. The shape is unaffected.- Returns:
- the count (≥0)
-
getNumVerticesInFace
public int getNumVerticesInFace(int faceIndex) Count the vertices in the specified face. The shape is unaffected.- Parameters:
faceIndex- the index of the face to query (≥0, <numFaces)- Returns:
- the count (≥0)
-
getPoint
Locate the specified vertex of the convex hull relative to its center of mass. The shape is unaffected.- Parameters:
pointIndex- the index of the point to locate (≥0, <numPoints)- Returns:
- a new location vector
-