Package com.jme3.bullet
Class SolverInfo
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.SolverInfo
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
Parameters used by the contact-and-constraint solver, based on Bullet's
btContactSolverInfo.
-
Field Summary
FieldsFields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the error-reduction parameter for contact constraints (native field: m_erp2).voidcopyAll(SolverInfo source) Copy all parameter values from the specified info.floatDetermine the global constraint-force mixing parameter (native field: m_globalCfm).booleanTest whether split impulse is enabled globally (native field: m_splitImpulse).floatjointErp()Return the error-reduction parameter for non-contact constraints (native field: m_erp).intminBatch()Determine the minimum batch size (native field: m_minimumSolverBatchSize).intmode()Determine the mode flags (native field: m_solverMode).intDetermine the number of iterations (native field: m_numIterations).voidsetContactErp(float erp) Alter the error-reduction parameter for contact constraints (native field: m_erp2).voidsetGlobalCfm(float cfm) Alter the global constraint-force mixing parameter (native field: m_globalCfm).voidsetJointErp(float erp) Alter the error-reduction parameter for non-contact constraints (native field: m_erp).voidsetMinBatch(int numConstraints) Alter the minimum batch size (native field: m_minimumSolverBatchSize).voidsetMode(int flags) Alter the mode flags (native field: m_solverMode).voidsetNumIterations(int numIterations) Alter the number of iterations (native field: m_numIterations).voidsetSplitImpulseEnabled(boolean setting) Alter whether split impulse is enabled globally (native field: m_splitImpulse).voidsetSplitImpulseErp(float erp) Alter the error-reduction parameter (ERP) used with split impulse (native field: m_splitImpulseTurnErp).voidsetSplitImpulseThreshold(float penetration) Alter the degree of penetration at which split impulse will be used.floatDetermine the error-reduction parameter (ERP) used with split impulse (native field: m_splitImpulseTurnErp).floatDetermine 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 com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObject
-
Field Details
-
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
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
-