java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.vhacd.Parameters
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class Parameters extends JoltPhysicsObject
A set of tuning parameters for the V-HACD algorithm. (native class: IVHACD::Parameters)
  • 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, or false to run on the current thread
    • getFillMode

      public FillMode 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, otherwise false
    • isDebugOutputEnabled

      public boolean isDebugOutputEnabled()
      Test whether debug output is enabled. The parameters are unaffected.
      Returns:
      true if it's enabled, otherwise false
    • setAsyncAcd

      public Parameters setAsyncAcd(boolean setting)
      Alter whether V-HACD should run asynchronously, on a new thread. (native field: m_asyncACD)
      Parameters:
      setting - true to run on a new thread, or false to run on the current thread (default=true)
      Returns:
      the modified properties, for chaining
    • setDebugOutputEnabled

      public Parameters setDebugOutputEnabled(boolean setting)
      Alter whether debug output is enabled.
      Parameters:
      setting - true to enable, otherwise false (default=false)
      Returns:
      the modified properties, for chaining
    • setFillMode

      public Parameters setFillMode(FillMode mode)
      Specify the algorithm that fills voxels to create a solid object. (native field: m_fillMode)
      Parameters:
      mode - an enum value (not null, default=FloodFill)
      Returns:
      the modified properties, for chaining
    • setFindBestPlane

      public Parameters setFindBestPlane(boolean setting)
      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

      public Parameters setMaxConvexHulls(int number)
      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

      public Parameters setMaxNumVerticesPerCh(int number)
      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

      public Parameters setMaxRecursionDepth(int depth)
      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

      public Parameters setMinEdgeLength(int length)
      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

      public Parameters setMinimumVolumePercentErrorAllowed(double percentage)
      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

      public Parameters setResolution(int maxVoxels)
      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

      public Parameters setShrinkWrap(boolean setting)
      Alter whether to shrinkwrap voxel positions to the source mesh. (native field: m_shrinkWrap)
      Parameters:
      setting - true to enable shrinkwrap, otherwise false (default=true)
      Returns:
      the modified properties, for chaining
    • equals

      public boolean equals(Object otherObject)
      Test for exact equivalence with another Object.
      Overrides:
      equals in class JoltPhysicsObject
      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 class JoltPhysicsObject
      Returns:
      a 32-bit value for use in hashing
    • toString

      public String toString()
      Represent this instance as a String.
      Overrides:
      toString in class JoltPhysicsObject
      Returns:
      a descriptive string of text (not null, not empty)