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:
ConstConvexShape,ConstJoltPhysicsObject,ConstShape,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
A
Shape to represent a convex hull defined by a collection of
vertices.-
Method Summary
Modifier and TypeMethodDescriptionvoiddrawShrunkShape(DebugRenderer renderer, RMat44Arg comTransform, Vec3Arg scale) Draw how vertices are moved when the shape is shrunk by the convex radius.floatReturn the convex radius.intgetFaceVertices(int faceIndex, int[] storeIndices) Enumerate all vertices in the specified face.intgetFaceVertices(int faceIndex, int maxVertices, int[] storeIndices) Enumerate all 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.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, getSubmergedVolume, getSupportFunction, setDensityMethods 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, scaleShape, setEmbedded, setVirtualAddressAsCoOwner, sRestoreFromBinaryState, toRef, toRefCMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstShape
copyDebugTriangles, countDebugTriangles, draw, drawGetSupportFunction, getCenterOfMass, getInnerRadius, getLeafShape, getLocalBounds, getMassProperties, getMaterial, getRefCount, getRevisionCount, getStats, getSubShapeIdBitsRecursive, getSubType, getType, getWorldSpaceBounds, getWorldSpaceBounds, isValidScale, makeScaleValid, mustBeStatic, saveBinaryState, scaleShape, toRefC
-
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
-