Package vhacd4
Class Vhacd4Parameters
java.lang.Object
com.jme3.bullet.NativePhysicsObject
vhacd4.Vhacd4Parameters
- All Implemented Interfaces:
Cloneable,Comparable<NativePhysicsObject>
A set of tuning parameters for convex decomposition, based on version 4 of
V-HACD's IVHACD::Parameters.
-
Field Summary
FieldsFields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Create a copy of these parameters.booleanTest for exact equivalence with another Object.voidRead all parameters from the specified InputStream.booleanTest whether debug output is enabled.Return the algorithm that fills voxels to create a solid object (native field: m_fillMode).intReturn the maximum number of convex hulls (native field: m_maxConvexHulls).intReturn the maximum recursion depth (native field: m_maxRecursionDepth).intReturn the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).intReturn the minimum edge length (native field: m_minEdgeLength).doubleReturn the tolerance for the percent difference between the voxel volume and the volume of the hull (native field: m_minimumVolumePercentErrorAllowed).intReturn the maximum number of voxels generated during the voxelization stage (native field: m_resolution).inthashCode()Generate the hash code for this instance.booleanisAsync()Test whether V-HACD should run on a new thread (native field: m_asyncACD).booleanTest whether V-HACD should try to find the optimal location for splitting hulls (native field: m_findBestPlane).booleanTest whether V-HACD should shrinkwrap voxel positions to the source mesh (native field: m_shrinkWrap).voidAdvance the fill mode to the next value.voidsetAsync(boolean setting) Alter whether V-HACD should run on a new thread (native field: m_asyncACD).voidsetDebugEnabled(boolean setting) Alter whether debug output is enabled.voidsetFillMode(FillMode mode) Specify the algorithm that fills voxels to create a solid object (native field: m_fillMode).voidsetFindBestPlane(boolean setting) Alter whether V-HACD should try to find the optimal location for splitting hulls (native field: m_findBestPlane).voidsetMaxHulls(int limit) Alter the maximum number of convex hulls (native field: m_maxConvexHulls).voidsetMaxRecursion(int depth) Alter the maximum recursion depth (native field: m_maxRecursionDepth).voidsetMaxVerticesPerHull(int limit) Alter the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).voidsetMinEdgeLength(int length) Alter the minimum edge length (native field: m_minEdgeLength).voidsetShrinkWrap(boolean setting) Alter whether to shrinkwrap voxel positions to the source mesh (native field: m_shrinkWrap).voidsetVolumePercentError(double percentage) Alter the tolerance for the percent difference between the voxel volume and the volume of the hull (native field: m_minimumVolumePercentErrorAllowed).voidsetVoxelResolution(int maxVoxels) Alter the maximum number of voxels generated during the voxelization stage (native field: m_resolution).toMap()Represent this instance as a Map, in order to make comparisons easier.voidWrite all parameters to the specified OutputStream.toString()Represent this instance as a String.Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, freeUnusedObjects, hasAssignedNativeObject, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, unassignNativeObject
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
Vhacd4Parameters
public Vhacd4Parameters()Instantiate the default tuning parameters.
-
-
Method Details
-
fromInputStream
Read all parameters from the specified InputStream.- Parameters:
is- the stream to read (not null)- Throws:
IOException- from DataInputStream
-
getDebugEnabled
public boolean getDebugEnabled()Test whether debug output is enabled.- Returns:
- true if enabled, otherwise false
-
getFillMode
Return the algorithm that fills voxels to create a solid object (native field: m_fillMode).- Returns:
- an enum value (not null)
-
getMaxHulls
public int getMaxHulls()Return the maximum number of convex hulls (native field: m_maxConvexHulls).- Returns:
- the limit (≥1, ≤1024)
-
getMaxRecursion
public int getMaxRecursion()Return the maximum recursion depth (native field: m_maxRecursionDepth).- Returns:
- the limit (≥2, ≤64)
-
getMaxVerticesPerHull
public int getMaxVerticesPerHull()Return the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).- Returns:
- the limit (≥4, ≤2_048)
-
getMinEdgeLength
public int getMinEdgeLength()Return the minimum edge length (native field: m_minEdgeLength).- Returns:
- the limit (≥1, ≤32)
-
getVolumePercentError
public double getVolumePercentError()Return the tolerance for the percent difference between the voxel volume and the volume of the hull (native field: m_minimumVolumePercentErrorAllowed).- Returns:
- the percentage (>0, <100)
-
getVoxelResolution
public int getVoxelResolution()Return the maximum number of voxels generated during the voxelization stage (native field: m_resolution).- Returns:
- the limit (≥10000, ≤64000000)
-
isAsync
public boolean isAsync()Test whether V-HACD should run on a new thread (native field: m_asyncACD).- Returns:
- true → create new thread, false → use the existing thread
-
isFindBestPlane
public boolean isFindBestPlane()Test whether V-HACD should try to find the optimal location for splitting hulls (native field: m_findBestPlane).- Returns:
- true → find optimal location, false → split in the middle
-
isShrinkWrap
public boolean isShrinkWrap()Test whether V-HACD should shrinkwrap voxel positions to the source mesh (native field: m_shrinkWrap).- Returns:
- true → shrinkwrap enabled, false → shrinkwrap disabled
-
nextFillMode
public void nextFillMode()Advance the fill mode to the next value. -
setAsync
public void setAsync(boolean setting) Alter whether V-HACD should run on a new thread (native field: m_asyncACD).- Parameters:
setting- true → create new thread, false → use the existing thread (default=true)
-
setDebugEnabled
public void setDebugEnabled(boolean setting) Alter whether debug output is enabled.- Parameters:
setting- true → enable, false → disable (default=false)
-
setFillMode
Specify the algorithm that fills voxels to create a solid object (native field: m_fillMode).- Parameters:
mode- the desired algorithm (not null, default=FloodFill)
-
setFindBestPlane
public void setFindBestPlane(boolean setting) Alter whether V-HACD should try to find the optimal location for splitting hulls (native field: m_findBestPlane).- Parameters:
setting- find optimal location, false → split in the middle (default=false)
-
setMaxHulls
public void setMaxHulls(int limit) Alter the maximum number of convex hulls (native field: m_maxConvexHulls).- Parameters:
limit- default = 64, min = 1, max = 1024)
-
setMaxRecursion
public void setMaxRecursion(int depth) Alter the maximum recursion depth (native field: m_maxRecursionDepth).Note: the native default is 10.
- Parameters:
depth- default = 14, min = 2, max = 64
-
setMaxVerticesPerHull
public void setMaxVerticesPerHull(int limit) Alter the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).Note: the native default is 64.
- Parameters:
limit- default = 32, min = 4, max = 2_048)
-
setMinEdgeLength
public void setMinEdgeLength(int length) Alter the minimum edge length (native field: m_minEdgeLength).- Parameters:
length- default = 2, min = 1, max = 32)
-
setShrinkWrap
public void setShrinkWrap(boolean setting) Alter whether to shrinkwrap voxel positions to the source mesh (native field: m_shrinkWrap).- Parameters:
setting- true → enable shrinkwrap, false → disable shrinkwrap (default=true)
-
setVolumePercentError
public void setVolumePercentError(double percentage) Alter the tolerance for the percent difference between the voxel volume and the volume of the hull (native field: m_minimumVolumePercentErrorAllowed).- Parameters:
percentage- default = 1, min = 0, max = 100
-
setVoxelResolution
public void setVoxelResolution(int maxVoxels) Alter the maximum number of voxels generated during the voxelization stage (native field: m_resolution).Note: the native default is 400_000.
- Parameters:
maxVoxels- default = 100_000, min = 10_000, max = 64_000_000
-
toMap
Represent this instance as a Map, in order to make comparisons easier.- Returns:
- a map of property names to values
-
toOutputStream
Write all parameters to the specified OutputStream.- Parameters:
os- the stream to write (not null)- Throws:
IOException- from DataOutputStream
-
clone
Create a copy of these parameters. -
equals
Test for exact equivalence with another Object.- Overrides:
equalsin classNativePhysicsObject- Parameters:
otherObject- (may be null, unaffected)- Returns:
- true if the objects are equivalent, otherwise false
-
hashCode
public int hashCode()Generate the hash code for this instance.- Overrides:
hashCodein classNativePhysicsObject- Returns:
- a 32-bit value for use in hashing
-
toString
Represent this instance as a String.- Overrides:
toStringin classNativePhysicsObject- Returns:
- a descriptive string of text (not null, not empty)
-