java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.vhacd.Parameters
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A set of tuning parameters for the V-HACD algorithm. (native class:
IVHACD::Parameters
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test for exact equivalence with another Object.boolean
Test whether V-HACD should run asynchronously, on a new thread.Return the algorithm that fills voxels to create a solid object.boolean
Test whether V-HACD should try to find the optimal location for splitting hulls.int
Return the maximum number of convex hulls.int
Return the maximum number of vertices per convex hull.int
Return the maximum recursion depth.int
Return the minimum edge length.double
Return the tolerance for the relative difference between the volumes of the voxels and the hulls.int
Return the maximum number of voxels generated during the voxelization stage.boolean
Test whether to shrinkwrap voxel positions to the source mesh.int
hashCode()
Generate the hash code for this instance.boolean
Test whether debug output is enabled.setAsyncAcd
(boolean setting) Alter whether V-HACD should run asynchronously, on a new thread.setDebugOutputEnabled
(boolean setting) Alter whether debug output is enabled.setFillMode
(FillMode mode) Specify the algorithm that fills voxels to create a solid object.setFindBestPlane
(boolean setting) Alter whether V-HACD should try to find the optimal location for splitting hulls.setMaxConvexHulls
(int number) Alter the maximum number of convex hulls.setMaxNumVerticesPerCh
(int number) Alter the maximum number of vertices per convex hull.setMaxRecursionDepth
(int depth) Alter the maximum recursion depth.setMinEdgeLength
(int length) Alter the minimum edge length.setMinimumVolumePercentErrorAllowed
(double percentage) Alter the tolerance for the relative difference between the volumes of the voxels and the hulls.setResolution
(int maxVoxels) Alter the maximum number of voxels generated during the voxelization stage.setShrinkWrap
(boolean setting) Alter whether to shrinkwrap voxel positions to the source mesh.toString()
Represent this instance as a String.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, getContainingObject, hasAssignedNativeObject, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, va
-
Constructor Details
-
Parameters
public Parameters()Instantiate the default tuning parameters.
-
-
Method Details
-
getAsyncAcd
public boolean getAsyncAcd()Test whether V-HACD should run asynchronously, on a new thread. The parameters are unaffected. (native field: m_asyncACD)- Returns:
true
to run on a new thread, orfalse
to run on the current thread
-
getFillMode
Return the algorithm that fills voxels to create a solid object. The parameters are unaffected. (native field: m_fillMode)- Returns:
- an enum value (not
null
)
-
getFindBestPlane
public boolean getFindBestPlane()Test whether V-HACD should try to find the optimal location for splitting hulls. The parameters are unaffected. (native field: m_findBestPlane)- Returns:
true
to split at the optimal location,false
to split in the middle
-
getMaxConvexHulls
public int getMaxConvexHulls()Return the maximum number of convex hulls. The parameters are unaffected. (native field: m_maxConvexHulls)- Returns:
- the maximum number (≥1, ≤1024)
-
getMaxNumVerticesPerCh
public int getMaxNumVerticesPerCh()Return the maximum number of vertices per convex hull. The parameters are unaffected. (native field: m_maxNumVerticesPerCH)- Returns:
- the maximum number (≥4, ≤2_048)
-
getMaxRecursionDepth
public int getMaxRecursionDepth()Return the maximum recursion depth. The parameters are unaffected. (native field: m_maxRecursionDepth)- Returns:
- the maximum number of levels (≥2, ≤64)
-
getMinEdgeLength
public int getMinEdgeLength()Return the minimum edge length. The parameters are unaffected. (native field: m_minEdgeLength)- Returns:
- the minimum length (≥1, ≤32)
-
getMinimumVolumePercentErrorAllowed
public double getMinimumVolumePercentErrorAllowed()Return the tolerance for the relative difference between the volumes of the voxels and the hulls. The parameters are unaffected. (native field: m_minimumVolumePercentErrorAllowed)- Returns:
- the maximum error (as a percentage, >0, <100)
-
getResolution
public int getResolution()Return the maximum number of voxels generated during the voxelization stage. The parameters are unaffected. (native field: m_resolution)- Returns:
- the maximum number (≥10_000, ≤64_000_000)
-
getShrinkWrap
public boolean getShrinkWrap()Test whether to shrinkwrap voxel positions to the source mesh. The parameters are unaffected. (native field: m_shrinkWrap)- Returns:
true
if shrinkwrap is enabled, otherwisefalse
-
isDebugOutputEnabled
public boolean isDebugOutputEnabled()Test whether debug output is enabled. The parameters are unaffected.- Returns:
true
if it's enabled, otherwisefalse
-
setAsyncAcd
Alter whether V-HACD should run asynchronously, on a new thread. (native field: m_asyncACD)- Parameters:
setting
-true
to run on a new thread, orfalse
to run on the current thread (default=true)- Returns:
- the modified properties, for chaining
-
setDebugOutputEnabled
Alter whether debug output is enabled.- Parameters:
setting
-true
to enable, otherwisefalse
(default=false)- Returns:
- the modified properties, for chaining
-
setFillMode
Specify the algorithm that fills voxels to create a solid object. (native field: m_fillMode)- Parameters:
mode
- an enum value (notnull
, default=FloodFill)- Returns:
- the modified properties, for chaining
-
setFindBestPlane
Alter whether V-HACD should try to find the optimal location for splitting hulls. (native field: m_findBestPlane)- Parameters:
setting
-true
to split at the optimal location,false
to split in the middle (default=false)- Returns:
- the modified properties, for chaining
-
setMaxConvexHulls
Alter the maximum number of convex hulls. (native field: m_maxConvexHulls)- Parameters:
number
- the desired maximum number (≥1, ≤1_024, default=64)- Returns:
- the modified properties, for chaining
-
setMaxNumVerticesPerCh
Alter the maximum number of vertices per convex hull. (native field: m_maxNumVerticesPerCH)- Parameters:
number
- the desired maximum number (≥4, ≤2_048, default=64)- Returns:
- the modified properties, for chaining
-
setMaxRecursionDepth
Alter the maximum recursion depth. (native field: m_maxRecursionDepth)- Parameters:
depth
- the desired maximum number of levels (≥2, ≤64, default=10)- Returns:
- the modified properties, for chaining
-
setMinEdgeLength
Alter the minimum edge length. (native field: m_minEdgeLength)- Parameters:
length
- the desired minimum (≥1, ≤32, default=2)- Returns:
- the modified properties, for chaining
-
setMinimumVolumePercentErrorAllowed
Alter the tolerance for the relative difference between the volumes of the voxels and the hulls. (native field: m_minimumVolumePercentErrorAllowed)- Parameters:
percentage
- the desired maximum error (as a percentage, >0, <100, default=1)- Returns:
- the modified properties, for chaining
-
setResolution
Alter the maximum number of voxels generated during the voxelization stage. (native field: m_resolution)- Parameters:
maxVoxels
- the desired maximum number (≥10_000, ≤ 64_000_000, default=400_000)- Returns:
- the modified properties, for chaining
-
setShrinkWrap
Alter whether to shrinkwrap voxel positions to the source mesh. (native field: m_shrinkWrap)- Parameters:
setting
-true
to enable shrinkwrap, otherwisefalse
(default=true)- Returns:
- the modified properties, for chaining
-
equals
Test for exact equivalence with another Object.- Overrides:
equals
in classJoltPhysicsObject
- Parameters:
otherObject
- (may benull
, unaffected)- Returns:
true
if the objects are equivalent, otherwisefalse
-
hashCode
public int hashCode()Generate the hash code for this instance.- Overrides:
hashCode
in classJoltPhysicsObject
- Returns:
- a 32-bit value for use in hashing
-
toString
Represent this instance as a String.- Overrides:
toString
in classJoltPhysicsObject
- Returns:
- a descriptive string of text (not
null
, not empty)
-