Class SolverInfo

All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class SolverInfo extends NativePhysicsObject
Parameters used by the contact-and-constraint solver, based on Bullet's btContactSolverInfo.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Logger
    message logger for this class

    Fields inherited from class com.jme3.bullet.NativePhysicsObject

    loggerN
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Return the error-reduction parameter for contact constraints (native field: m_erp2).
    void
    Copy all parameter values from the specified info.
    float
    Determine the global constraint-force mixing parameter (native field: m_globalCfm).
    boolean
    Test whether split impulse is enabled globally (native field: m_splitImpulse).
    float
    Return the error-reduction parameter for non-contact constraints (native field: m_erp).
    int
    Determine the minimum batch size (native field: m_minimumSolverBatchSize).
    int
    Determine the mode flags (native field: m_solverMode).
    int
    Determine the number of iterations (native field: m_numIterations).
    void
    setContactErp(float erp)
    Alter the error-reduction parameter for contact constraints (native field: m_erp2).
    void
    setGlobalCfm(float cfm)
    Alter the global constraint-force mixing parameter (native field: m_globalCfm).
    void
    setJointErp(float erp)
    Alter the error-reduction parameter for non-contact constraints (native field: m_erp).
    void
    setMinBatch(int numConstraints)
    Alter the minimum batch size (native field: m_minimumSolverBatchSize).
    void
    setMode(int flags)
    Alter the mode flags (native field: m_solverMode).
    void
    setNumIterations(int numIterations)
    Alter the number of iterations (native field: m_numIterations).
    void
    setSplitImpulseEnabled(boolean setting)
    Alter whether split impulse is enabled globally (native field: m_splitImpulse).
    void
    setSplitImpulseErp(float erp)
    Alter the error-reduction parameter (ERP) used with split impulse (native field: m_splitImpulseTurnErp).
    void
    setSplitImpulseThreshold(float penetration)
    Alter the degree of penetration at which split impulse will be used.
    float
    Determine the error-reduction parameter (ERP) used with split impulse (native field: m_splitImpulseTurnErp).
    float
    Determine the minimum degree of penetration at which split impulse would be used, assuming it's not enabled globally (native field: m_splitImpulsePenetrationThreshold).

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
  • Method Details

    • contactErp

      public float contactErp()
      Return the error-reduction parameter for contact constraints (native field: m_erp2).
      Returns:
      the parameter value
    • copyAll

      public void copyAll(SolverInfo source)
      Copy all parameter values from the specified info.
      Parameters:
      source - the info to copy from (not null, unaffected)
    • globalCfm

      public float globalCfm()
      Determine the global constraint-force mixing parameter (native field: m_globalCfm).
      Returns:
      the parameter value (≥0)
    • isSplitImpulseEnabled

      public boolean isSplitImpulseEnabled()
      Test whether split impulse is enabled globally (native field: m_splitImpulse).
      Returns:
      true if using split impulse, otherwise false
    • jointErp

      public float jointErp()
      Return the error-reduction parameter for non-contact constraints (native field: m_erp).
      Returns:
      the parameter value
    • minBatch

      public int minBatch()
      Determine the minimum batch size (native field: m_minimumSolverBatchSize).
      Returns:
      the number of constraints in a batch (≥1)
    • mode

      public int mode()
      Determine the mode flags (native field: m_solverMode).
      Returns:
      the bitmask value
      See Also:
    • numIterations

      public int numIterations()
      Determine the number of iterations (native field: m_numIterations).
      Returns:
      the count (>0)
    • setContactErp

      public void setContactErp(float erp)
      Alter the error-reduction parameter for contact constraints (native field: m_erp2).
      Parameters:
      erp - the desired parameter value (default=0.2)
    • setGlobalCfm

      public void setGlobalCfm(float cfm)
      Alter the global constraint-force mixing parameter (native field: m_globalCfm).
      Parameters:
      cfm - the desired parameter value (≥0, default=0)
    • setJointErp

      public void setJointErp(float erp)
      Alter the error-reduction parameter for non-contact constraints (native field: m_erp).
      Parameters:
      erp - the desired parameter value (default=0.2)
    • setMinBatch

      public void setMinBatch(int numConstraints)
      Alter the minimum batch size (native field: m_minimumSolverBatchSize).
      Parameters:
      numConstraints - the desired number of constraints per batch (≥1, default=128)
    • setMode

      public void setMode(int flags)
      Alter the mode flags (native field: m_solverMode).
      Parameters:
      flags - the desired bitmask (default=0x114 for a MultiBodySpace, otherwise 0x104)
      See Also:
    • setNumIterations

      public void setNumIterations(int numIterations)
      Alter the number of iterations (native field: m_numIterations).

      Use 4 for low quality, 20 for high quality.

      Parameters:
      numIterations - the desired number of iterations (≥1, default=10)
    • setSplitImpulseEnabled

      public void setSplitImpulseEnabled(boolean setting)
      Alter whether split impulse is enabled globally (native field: m_splitImpulse).
      Parameters:
      setting - the desired setting (default=true)
    • setSplitImpulseErp

      public void setSplitImpulseErp(float erp)
      Alter the error-reduction parameter (ERP) used with split impulse (native field: m_splitImpulseTurnErp).
      Parameters:
      erp - the parameter (default=0.1)
    • setSplitImpulseThreshold

      public void setSplitImpulseThreshold(float penetration)
      Alter the degree of penetration at which split impulse will be used. This setting no effect while split impulse is enabled globally (native field: m_splitImpulsePenetrationThreshold).
      Parameters:
      penetration - the penetration threshold (in physics-space units, default=-0.04)
    • splitImpulseErp

      public float splitImpulseErp()
      Determine the error-reduction parameter (ERP) used with split impulse (native field: m_splitImpulseTurnErp).
      Returns:
      the parameter value
    • splitImpulseThreshold

      public float splitImpulseThreshold()
      Determine the minimum degree of penetration at which split impulse would be used, assuming it's not enabled globally (native field: m_splitImpulsePenetrationThreshold).
      Returns:
      the parameter value