Package com.github.stephengold.joltjni
Class ConvexHullShapeSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ShapeSettings
com.github.stephengold.joltjni.ConvexShapeSettings
com.github.stephengold.joltjni.ConvexHullShapeSettings
- All Implemented Interfaces:
ConstConvexShapeSettings
,ConstJoltPhysicsObject
,ConstShapeSettings
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
ConvexHullShape
.-
Constructor Summary
ConstructorsConstructorDescriptionConvexHullShapeSettings
(int numPoints, FloatBuffer points) Instantiate settings for the points in the specified buffer.ConvexHullShapeSettings
(int numPoints, FloatBuffer points, float maxConvexRadius) Instantiate settings for the specified parameters.ConvexHullShapeSettings
(int numPoints, FloatBuffer points, float maxConvexRadius, ConstPhysicsMaterial material) Instantiate settings for the specified parameters.ConvexHullShapeSettings
(Vec3Arg... points) Instantiate settings for the specified points.ConvexHullShapeSettings
(Vec3Arg[] points, float maxConvexRadius) Instantiate settings for the specified parameters.ConvexHullShapeSettings
(Vec3Arg[] points, float maxConvexRadius, ConstPhysicsMaterial material) Instantiate settings for the specified parameters.ConvexHullShapeSettings
(Collection<Vec3Arg> points) Instantiate settings for the specified collection of points.ConvexHullShapeSettings
(Collection<Vec3Arg> points, float maxConvexRadius) Instantiate settings for the specified parameters.ConvexHullShapeSettings
(Collection<Vec3Arg> points, float maxConvexRadius, ConstPhysicsMaterial material) Instantiate settings for the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionint
Count the points to use when creating the hull.float
Return the positional tolerance used when generating the hull.float
Return the convex radius.float
Return the maximum separation between the shrunk hull + convex radius and the actual hull.void
setHullTolerance
(float tolerance) Alter the positional tolerance used when generating the hull.void
setMaxConvexRadius
(float radius) Alter the convex radius.void
setMaxErrorConvexRadius
(float maxError) Alter the maximum separation between the shrunk hull plus convex radius and the actual hull.void
Replace any existing points with the specified ones.Methods inherited from class com.github.stephengold.joltjni.ConvexShapeSettings
getDensity, getMaterial, setDensity, setMaterial
Methods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, create, getRefCount, setEmbedded, 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
-
Constructor Details
-
ConvexHullShapeSettings
Instantiate settings for the specified collection of points.- Parameters:
points
- a list of point locations (not null, unaffected)
-
ConvexHullShapeSettings
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) ornull
for default properties (default=null)
-
ConvexHullShapeSettings
Instantiate settings for the specified points.- Parameters:
points
- the array of desired point locations (not null, unaffected)
-
ConvexHullShapeSettings
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) ornull
for default properties (default=null)
-
ConvexHullShapeSettings
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
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) ornull
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
Replace any existing points with the specified ones.- Parameters:
points
- the array of desired point locations (not null, unaffected)
-