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<JoltPhysicsObject>
A
Shape
to represent a convex hull defined by a collection of
vertices.-
Method Summary
Modifier and TypeMethodDescriptionvoid
drawShrunkShape
(DebugRenderer renderer, RMat44Arg comTransform, Vec3Arg scale) Draw how vertices are moved when the shape is shrunk by the convex radius.float
Return the convex radius.int
getFaceVertices
(int faceIndex, int[] storeIndices) Enumerate all vertices in the specified face.int
getFaceVertices
(int faceIndex, int maxVertices, int[] storeIndices) Enumerate all vertices in the specified face.int
Count the faces in the convex hull.int
Count the vertices of the convex hull.int
getNumVerticesInFace
(int faceIndex) Count the vertices in the specified face.Plane[]
Enumerate all planes of the faces.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.ConvexShape
getDensity, getSupportFunction, setDensity
Methods inherited from class com.github.stephengold.joltjni.Shape
copyDebugTriangles, countDebugTriangles, draw, drawGetSupportFunction, getCenterOfMass, getInnerRadius, getLeafShape, getLocalBounds, getMassProperties, getMaterial, getRefCount, getRevisionCount, getStats, getSubShapeIdBitsRecursive, getSubType, getType, getWorldSpaceBounds, getWorldSpaceBounds, isValidScale, makeScaleValid, mustBeStatic, saveBinaryState, setEmbedded, sRestoreFromBinaryState, toRef, toRefC
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
drawShrunkShape
Draw how vertices are moved when the shape is shrunk by the convex radius. The shape is unaffected.- Parameters:
renderer
- the renderer to use (not null)comTransform
- the center-of-mass transform (not null, unaffected)scale
- the scaling to apply (not null, unaffected)
-
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 all 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 all 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)
-
getPlanes
Enumerate all planes of the faces. The shape is unaffected.- Returns:
- a new array of new objects
-
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
-