Class ConvexHullShape

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstShape, RefTarget, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class ConvexHullShape extends ConvexShape
A Shape to represent a convex hull defined by a collection of vertices.
  • 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

      public Vec3 getPoint(int pointIndex)
      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