Package vhacd
Class VHACDParameters
java.lang.Object
com.jme3.bullet.NativePhysicsObject
vhacd.VHACDParameters
- All Implemented Interfaces:
Cloneable
,Comparable<NativePhysicsObject>
A set of tuning parameters for convex decomposition, based on classic
V-HACD's IVHACD::Parameters.
-
Field Summary
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Create a copy of these parameters.boolean
Test for exact equivalence with another Object.void
Read selected parameters from the specified InputStream.Return the decomposition mode (native field: m_mode).double
getAlpha()
Return the bias toward clipping along symmetry planes.double
getBeta()
Return the bias toward clipping along revolution axes (native field: m_beta).int
Return the precision of the convex-hull generation process (native field: m_convexhullDownsampling).boolean
Test whether debug output is enabled.double
Return the maximum concavity (native field: m_concavity).int
Return the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).double
Return the minimum volume for added vertices (native field: m_minVolumePerCH).boolean
getPCA()
Test whether to normalize the mesh (native field: m_pca).int
Return the granularity of the search (native field: m_planeDownsampling).int
Return the maximum number of voxels generated during the voxelization stage (native field: m_resolution).int
hashCode()
Generate the hash code for this instance.void
setACDMode
(ACDMode mode) Set approximate convex decomposition mode (native field: m_mode).void
setAlpha
(double alpha) Set bias toward clipping along symmetry planes (native field: m_alpha).void
setBeta
(double beta) Set bias toward clipping along revolution axes (native field: m_beta).void
setConvexHullDownSampling
(int precision) Set precision of the convex-hull generation process during the clipping plane selection stage (native field: m_convexhullDownsampling).void
setDebugEnabled
(boolean setting) Alter whether debug output is enabled.void
setMaxConcavity
(double concavity) Set maximum concavity (native field: m_concavity).void
setMaxVerticesPerHull
(int limit) Alter the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).void
setMinVolumePerHull
(double volume) Set the minimum volume to add vertices to convex hulls (native field: m_minVolumePerCH).void
setPCA
(boolean v) Enable/disable normalizing the mesh before applying the convex decomposition (native field: m_pca).void
setPlaneDownSampling
(int v) Set granularity of the search for the "best" clipping plane (native field: m_planeDownsampling).void
setVoxelResolution
(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.void
Write selected 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
-
VHACDParameters
public VHACDParameters()Instantiate the default tuning parameters.
-
-
Method Details
-
fromInputStream
Read selected parameters from the specified InputStream.- Parameters:
is
- the stream to read (not null)- Throws:
IOException
- from DataInputStream
-
getACDMode
Return the decomposition mode (native field: m_mode).- Returns:
- an enum value (not null)
-
getAlpha
public double getAlpha()Return the bias toward clipping along symmetry planes. (native field: m_alpha).- Returns:
- alpha (≥0, ≤1)
-
getBeta
public double getBeta()Return the bias toward clipping along revolution axes (native field: m_beta).- Returns:
- beta (≥0, ≤1)
-
getConvexHullDownSampling
public int getConvexHullDownSampling()Return the precision of the convex-hull generation process (native field: m_convexhullDownsampling).- Returns:
- precision (≥1, ≤16)
-
getDebugEnabled
public boolean getDebugEnabled()Test whether debug output is enabled.- Returns:
- true if enabled, otherwise false
-
getMaxConcavity
public double getMaxConcavity()Return the maximum concavity (native field: m_concavity).- Returns:
- concavity (≥0, ≤1)
-
getMaxVerticesPerHull
public int getMaxVerticesPerHull()Return the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).- Returns:
- the limit (≥4, ≤1024)
-
getMinVolumePerHull
public double getMinVolumePerHull()Return the minimum volume for added vertices (native field: m_minVolumePerCH).- Returns:
- the volume (≥0, ≤0.01)
-
getPCA
public boolean getPCA()Test whether to normalize the mesh (native field: m_pca).- Returns:
- true → normalize, false → don't normalize
-
getPlaneDownSampling
public int getPlaneDownSampling()Return the granularity of the search (native field: m_planeDownsampling).- Returns:
- granularity (≥1, ≤16)
-
getVoxelResolution
public int getVoxelResolution()Return the maximum number of voxels generated during the voxelization stage (native field: m_resolution).- Returns:
- number (≥10000, ≤64000000)
-
setACDMode
Set approximate convex decomposition mode (native field: m_mode).- Parameters:
mode
- default = VOXEL
-
setAlpha
public void setAlpha(double alpha) Set bias toward clipping along symmetry planes (native field: m_alpha).- Parameters:
alpha
- default = 0.05, min = 0.0, max = 1.0,
-
setBeta
public void setBeta(double beta) Set bias toward clipping along revolution axes (native field: m_beta).- Parameters:
beta
- default = 0.05, min = 0.0, max = 1.0
-
setConvexHullDownSampling
public void setConvexHullDownSampling(int precision) Set precision of the convex-hull generation process during the clipping plane selection stage (native field: m_convexhullDownsampling).- Parameters:
precision
- default = 4, min = 1, max = 16
-
setDebugEnabled
public void setDebugEnabled(boolean setting) Alter whether debug output is enabled.- Parameters:
setting
- true → enable, false → disable (default=false)
-
setMaxConcavity
public void setMaxConcavity(double concavity) Set maximum concavity (native field: m_concavity).- Parameters:
concavity
- default = 0.0025, min = 0.0, max = 1.0Note: the native default is 0.001.
-
setMaxVerticesPerHull
public void setMaxVerticesPerHull(int limit) Alter the maximum number of vertices per convex hull (native field: m_maxNumVerticesPerCH).- Parameters:
limit
- default = 32, min = 4, max = 1024Note: the native default is 64.
-
setMinVolumePerHull
public void setMinVolumePerHull(double volume) Set the minimum volume to add vertices to convex hulls (native field: m_minVolumePerCH).- Parameters:
volume
- default = 0.0001, min = 0.0, max = 0.01
-
setPCA
public void setPCA(boolean v) Enable/disable normalizing the mesh before applying the convex decomposition (native field: m_pca).- Parameters:
v
- default = false
-
setPlaneDownSampling
public void setPlaneDownSampling(int v) Set granularity of the search for the "best" clipping plane (native field: m_planeDownsampling).- Parameters:
v
- default = 4, min = 1, max = 16
-
setVoxelResolution
public void setVoxelResolution(int maxVoxels) Alter the maximum number of voxels generated during the voxelization stage (native field: m_resolution).- 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 selected 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:
equals
in 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:
hashCode
in classNativePhysicsObject
- Returns:
- a 32-bit value for use in hashing
-
toString
Represent this instance as a String.- Overrides:
toString
in classNativePhysicsObject
- Returns:
- a descriptive string of text (not null, not empty)
-