Class ConvexHullShapeSettings

All Implemented Interfaces:
ConstConvexShapeSettings, ConstJoltPhysicsObject, ConstShapeSettings, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class ConvexHullShapeSettings extends ConvexShapeSettings
Settings used to construct a ConvexHullShape.
  • Constructor Details

    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(Collection<Vec3Arg> points)
      Instantiate settings for the specified collection of points.
      Parameters:
      points - a list of point locations (not null, unaffected)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(Collection<Vec3Arg> points, float maxConvexRadius)
      Instantiate settings for the specified parameters.
      Parameters:
      points - a collection of point locations (not null, unaffected)
      maxConvexRadius - the desired maximum convex radius (≥0, default=0.05)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(Collection<Vec3Arg> points, float maxConvexRadius, ConstPhysicsMaterial material)
      Instantiate settings for the specified parameters.
      Parameters:
      points - a collection of point locations (not null, unaffected)
      maxConvexRadius - the desired maximum convex radius (≥0, default=0.05)
      material - the desired surface properties (not null, unaffected) or null for default properties (default=null)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(Vec3Arg... points)
      Instantiate settings for the specified points.
      Parameters:
      points - the array of desired point locations (not null, unaffected)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(Vec3Arg[] points, float maxConvexRadius)
      Instantiate settings for the specified parameters.
      Parameters:
      points - an array of point locations (not null, unaffected)
      maxConvexRadius - the desired maximum convex radius (≥0, default=0.05)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(Vec3Arg[] points, float maxConvexRadius, ConstPhysicsMaterial material)
      Instantiate settings for the specified parameters.
      Parameters:
      points - an array of point locations (not null, unaffected)
      maxConvexRadius - the desired maximum convex radius (≥0, default=0.05)
      material - the desired surface properties (not null, unaffected) or null for default properties (default=null)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(int numPoints, FloatBuffer points)
      Instantiate settings for the points in the specified buffer.
      Parameters:
      numPoints - the number of points (≥0)
      points - a direct buffer containing point locations (not null, unaffected)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(int numPoints, FloatBuffer points, float maxConvexRadius)
      Instantiate settings for the specified parameters.
      Parameters:
      numPoints - the number of points (≥0)
      points - a direct buffer containing point locations (not null, unaffected)
      maxConvexRadius - the desired maximum convex radius (≥0, default=0.05)
    • ConvexHullShapeSettings

      public ConvexHullShapeSettings(int numPoints, FloatBuffer points, float maxConvexRadius, ConstPhysicsMaterial material)
      Instantiate settings for the specified parameters.
      Parameters:
      numPoints - the number of points (≥0)
      points - a direct buffer containing point locations (not null, unaffected)
      maxConvexRadius - the desired maximum convex radius (≥0, default=0.05)
      material - the desired surface properties (not null, unaffected) or null for default properties (default=null)
  • Method Details

    • countPoints

      public int countPoints()
      Count the points to use when creating the hull. The settings are unaffected.
      Returns:
      the count (≥0)
    • getHullTolerance

      public float getHullTolerance()
      Return the positional tolerance used when generating the hull. The settings are unaffected. (native attribute: mHullTolerance)
      Returns:
      the distance (≥0)
    • getMaxConvexRadius

      public float getMaxConvexRadius()
      Return the convex radius. The settings are unaffected. (native attribute: mMaxConvexRadius)
      Returns:
      the convex radius (≥0)
    • getMaxErrorConvexRadius

      public float getMaxErrorConvexRadius()
      Return the maximum separation between the shrunk hull + convex radius and the actual hull. The settings are unaffected. (native attribute: mMaxErrorConvexRadius)
      Returns:
      the maximum separation (≥0)
    • setHullTolerance

      public void setHullTolerance(float tolerance)
      Alter the positional tolerance used when generating the hull. (native attribute: mHullTolerance)
      Parameters:
      tolerance - the desired tolerance (≥0, default=0.001)
    • setMaxConvexRadius

      public void setMaxConvexRadius(float radius)
      Alter the convex radius. (native attribute: mMaxConvexRadius)
      Parameters:
      radius - the desired convex radius (≥0, default=0)
    • setMaxErrorConvexRadius

      public void setMaxErrorConvexRadius(float maxError)
      Alter the maximum separation between the shrunk hull plus convex radius and the actual hull. (native attribute: mMaxErrorConvexRadius)
      Parameters:
      maxError - the desired maximum separation (≥0, default=0.05)
    • setPoints

      public void setPoints(Vec3Arg... points)
      Replace any existing points with the specified ones.
      Parameters:
      points - the array of desired point locations (not null, unaffected)