Package com.github.stephengold.joltjni
Class ConvexHullShapeSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
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,ConstSerializableObject,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.Instantiate a copy of the specified settings.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<?> points) Instantiate settings for the specified collection of points.ConvexHullShapeSettings(Collection<?> points, float maxConvexRadius) Instantiate settings for the specified parameters.ConvexHullShapeSettings(Collection<?> points, float maxConvexRadius, ConstPhysicsMaterial material) Instantiate settings for the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the specified point to the hull.copyPoint(int index) Copy one of the points to use when creating the hull.Vec3[]Copy the points to use when creating the hull.intCount the points to use when creating the hull.floatReturn the positional tolerance used when generating the hull.floatReturn the convex radius.floatReturn the maximum separation between the shrunk hull + convex radius and the actual hull.voidsetHullTolerance(float tolerance) Alter the positional tolerance used when generating the hull.voidsetMaxConvexRadius(float radius) Alter the convex radius.voidsetMaxErrorConvexRadius(float maxError) Alter the maximum separation between the shrunk hull plus convex radius and the actual hull.voidReplace the specified point with new coordinates.voidReplace any existing points with the specified ones.Methods inherited from class com.github.stephengold.joltjni.ConvexShapeSettings
getDensity, getMaterial, setDensity, setMaterialMethods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, cloneShapeSettings, create, getRefCount, setEmbedded, setVirtualAddressAsCoOwner, toRef, toRefCMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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.ConstSerializableObject
getRttiMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstShapeSettings
create, getRefCount, toRefC
-
Constructor Details
-
ConvexHullShapeSettings
Instantiate settings for the specified collection of points.- Parameters:
points- a collection of point locations (notnull, unaffected)
-
ConvexHullShapeSettings
Instantiate settings for the specified parameters.- Parameters:
points- a collection of point locations (notnull, unaffected)maxConvexRadius- the desired maximum convex radius (≥0, default=0.05)
-
ConvexHullShapeSettings
public ConvexHullShapeSettings(Collection<?> points, float maxConvexRadius, ConstPhysicsMaterial material) Instantiate settings for the specified parameters.- Parameters:
points- a collection of point locations (notnull, unaffected)maxConvexRadius- the desired maximum convex radius (≥0, default=0.05)material- the desired surface properties (notnull, unaffected) ornullfor default properties (default=null)
-
ConvexHullShapeSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
ConvexHullShapeSettings
Instantiate settings for the points in the specified buffer.- Parameters:
numPoints- the number of points (≥0)points- a direct buffer containing point locations (notnull, unaffected)
-
ConvexHullShapeSettings
Instantiate settings for the specified parameters.- Parameters:
numPoints- the number of points (≥0)points- a direct buffer containing point locations (notnull, 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 (notnull, unaffected)maxConvexRadius- the desired maximum convex radius (≥0, default=0.05)material- the desired surface properties (notnull, unaffected) ornullfor default properties (default=null)
-
ConvexHullShapeSettings
Instantiate settings for the specified points.- Parameters:
points- the array of desired point locations (notnull, unaffected)
-
ConvexHullShapeSettings
Instantiate settings for the specified parameters.- Parameters:
points- an array of point locations (notnull, 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 (notnull, unaffected)maxConvexRadius- the desired maximum convex radius (≥0, default=0.05)material- the desired surface properties (notnull, unaffected) ornullfor default properties (default=null)
-
-
Method Details
-
addPoint
Add the specified point to the hull.- Parameters:
point- the coordinates of the point to add (notnull, unaffected)
-
copyPoint
Copy one of the points to use when creating the hull. The settings are unaffected.- Parameters:
index- the index of the point to copy (≥0)- Returns:
- a new location vector
-
copyPoints
Copy the points to use when creating the hull. The settings are unaffected. (native attribute: mPoints)- Returns:
- a new array of new vectors
-
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)
-
setPoint
Replace the specified point with new coordinates.- Parameters:
index- which point to replace (≥0)point- the desired coordinates (notnull, unaffected)
-
setPoints
Replace any existing points with the specified ones. (native attribute: mPoints)- Parameters:
points- the array of desired point locations (notnull, unaffected)
-