- Object
-
- Settings
-
public class Settings extends Object
Responsible for housing all of the dynamics engine's settings.- Since:
- 1.0.0
- Version:
- 4.0.0
- Author:
- William Bittle
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_ANGULAR_TOLERANCE
The default angular tolerance; in radiansstatic double
DEFAULT_BAUMGARTE
The default baumgartestatic double
DEFAULT_LINEAR_TOLERANCE
The default linear tolerance; in metersstatic double
DEFAULT_MAXIMUM_ANGULAR_CORRECTION
The default maximum angular correction; in radiansstatic double
DEFAULT_MAXIMUM_AT_REST_ANGULAR_VELOCITY
The default maximum angular velocity for aPhysicsBody
to be flagged as at-rest; in radians/secondstatic double
DEFAULT_MAXIMUM_AT_REST_LINEAR_VELOCITY
The default maximum velocity for aPhysicsBody
to be flagged as at-rest; in meters/secondstatic double
DEFAULT_MAXIMUM_LINEAR_CORRECTION
The default maximum linear correction; in metersstatic double
DEFAULT_MAXIMUM_ROTATION
The default maximum rotation aPhysicsBody
can have in one time step; in radiansstatic double
DEFAULT_MAXIMUM_TRANSLATION
The default maximum translation aPhysicsBody
can have in one time step; in metersstatic double
DEFAULT_MAXIMUM_WARM_START_DISTANCE
The default warm starting distance; in meters2static double
DEFAULT_MINIMUM_AT_REST_TIME
The default required time aPhysicsBody
must maintain small motion to be flagged as at-rest; in secondsstatic double
DEFAULT_RESTITUTION_VELOCITY
The default restitution velocity; in meters/secondstatic double
DEFAULT_SLEEP_ANGULAR_VELOCITY
Deprecated.Deprecated in 4.0.0.static double
DEFAULT_SLEEP_LINEAR_VELOCITY
Deprecated.Deprecated in 4.0.0.static double
DEFAULT_SLEEP_TIME
Deprecated.Deprecated in 4.0.0.static int
DEFAULT_SOLVER_ITERATIONS
The default number of solver iterationsstatic double
DEFAULT_STEP_FREQUENCY
The default step frequency of the dynamics engine; in secondsstatic double
DEFAULT_WARM_START_DISTANCE
Deprecated.Deprecated in 4.0.0.
-
Constructor Summary
Constructors Constructor Description Settings()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Settings
copy()
Creates a deep copy of this settings object.void
copy(Settings settings)
Copies all the settings from the given settings to this settings.double
getAngularTolerance()
Returns the angular tolerance.double
getAngularToleranceSquared()
Returns the angular tolerance squared.double
getBaumgarte()
Returns the baumgarte factor.ContinuousDetectionMode
getContinuousDetectionMode()
Returns the continuous collision detection mode.double
getLinearTolerance()
Returns the linear tolerance.double
getLinearToleranceSquared()
Returns the linear tolerance squared.double
getMaximumAngularCorrection()
Returns the maximum angular correction.double
getMaximumAngularCorrectionSquared()
Returns the maximum angular correction squared.double
getMaximumAtRestAngularVelocity()
Returns the maximum at-rest angular velocity.double
getMaximumAtRestAngularVelocitySquared()
Returns the maximum at-rest angular velocity squared.double
getMaximumAtRestLinearVelocity()
Returns the maximum at-rest linear velocity.double
getMaximumAtRestLinearVelocitySquared()
Returns the maximum at-rest linear velocity squared.double
getMaximumLinearCorrection()
Returns the maximum linear correction.double
getMaximumLinearCorrectionSquared()
Returns the maximum linear correction squared.double
getMaximumRotation()
Returns the maximum rotation aPhysicsBody
can have in one time step.double
getMaximumRotationSquared()
Returns the max rotation squared.double
getMaximumTranslation()
Returns the maximum translation aPhysicsBody
can have in one time step.double
getMaximumTranslationSquared()
Returns the maximum translation squared.double
getMaximumWarmStartDistance()
Returns the maximum warm start distance.double
getMaximumWarmStartDistanceSquared()
Returns the maximum warm start distance squared.double
getMinimumAtRestTime()
Returns the minimum time that aPhysicsBody
is motionless before being flagged as at-rest.int
getPositionConstraintSolverIterations()
Returns the number of iterations used to solve position constraints.double
getRestitutionVelocity()
Returns the restitution velocity.double
getRestitutionVelocitySquared()
Returns the restitution velocity squared.double
getSleepAngularVelocity()
Deprecated.Deprecated in 4.0.0.double
getSleepAngularVelocitySquared()
Deprecated.Deprecated in 4.0.0.double
getSleepLinearVelocity()
Deprecated.Deprecated in 4.0.0.double
getSleepLinearVelocitySquared()
Deprecated.Deprecated in 4.0.0.double
getSleepTime()
Deprecated.Deprecated in 4.0.0.double
getStepFrequency()
Returns the step frequency of the dynamics engine in seconds.int
getVelocityConstraintSolverIterations()
Returns the number of iterations used to solve velocity constraints.double
getWarmStartDistance()
Deprecated.Deprecated in 4.0.0.double
getWarmStartDistanceSquared()
Deprecated.Deprecated in 4.0.0.boolean
isAtRestDetectionEnabled()
Returns true if the engine automatically flagsPhysicsBody
s as at-rest.boolean
isAutoSleepingEnabled()
Deprecated.Deprecated in 4.0.0.boolean
isWarmStartingEnabled()
Returns true if warm starting of contacts is enabled.void
reset()
Resets the settings back to defaults.void
setAngularTolerance(double angularTolerance)
Sets the angular tolerance.void
setAtRestDetectionEnabled(boolean flag)
Sets whether the engine automatically flagsPhysicsBody
s as at-rest.void
setAutoSleepingEnabled(boolean flag)
Deprecated.Deprecated in 4.0.0.void
setBaumgarte(double baumgarte)
Sets the baumgarte factor.void
setContinuousDetectionMode(ContinuousDetectionMode mode)
Sets the continuous collision detection mode.void
setLinearTolerance(double linearTolerance)
Sets the linear tolerance.void
setMaximumAngularCorrection(double maximumAngularCorrection)
Sets the maximum angular correction.void
setMaximumAtRestAngularVelocity(double maximumAtRestAngularVelocity)
Sets the maximum at-rest angular velocity.void
setMaximumAtRestLinearVelocity(double maximumAtRestLinearVelocity)
Sets the maximum at-rest linear velocity.void
setMaximumLinearCorrection(double maximumLinearCorrection)
Sets the maximum linear correction.void
setMaximumRotation(double maximumRotation)
Sets the maximum rotation aPhysicsBody
can have in one time step.void
setMaximumTranslation(double maximumTranslation)
Sets the maximum translation aPhysicsBody
can have in one time step.void
setMaximumWarmStartDistance(double maximumWarmStartDistance)
Sets the maximum warm start distance.void
setMinimumAtRestTime(double minimumAtRestTime)
Sets the minimum at-rest time.void
setPositionConstraintSolverIterations(int positionConstraintSolverIterations)
Sets the number of iterations used to solve position constraints.void
setRestitutionVelocity(double restitutionVelocity)
Sets the restitution velocity.void
setSleepAngularVelocity(double sleepAngularVelocity)
Deprecated.Deprecated in 4.0.0.void
setSleepLinearVelocity(double sleepLinearVelocity)
Deprecated.Deprecated in 4.0.0.void
setSleepTime(double sleepTime)
Deprecated.Deprecated in 4.0.0.void
setStepFrequency(double stepFrequency)
Sets the step frequency of the dynamics engine.void
setVelocityConstraintSolverIterations(int velocityConstraintSolverIterations)
Sets the number of iterations used to solve velocity constraints.void
setWarmStartDistance(double warmStartDistance)
Deprecated.Deprecated in 4.0.0.void
setWarmStartingEnabled(boolean flag)
Sets the warm starting of contacts to enabled.String
toString()
-
-
-
Field Detail
-
DEFAULT_STEP_FREQUENCY
public static final double DEFAULT_STEP_FREQUENCY
The default step frequency of the dynamics engine; in seconds- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_TRANSLATION
public static final double DEFAULT_MAXIMUM_TRANSLATION
The default maximum translation aPhysicsBody
can have in one time step; in meters- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_ROTATION
public static final double DEFAULT_MAXIMUM_ROTATION
The default maximum rotation aPhysicsBody
can have in one time step; in radians- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_AT_REST_LINEAR_VELOCITY
public static final double DEFAULT_MAXIMUM_AT_REST_LINEAR_VELOCITY
The default maximum velocity for aPhysicsBody
to be flagged as at-rest; in meters/second- Since:
- 4.0.0
- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_AT_REST_ANGULAR_VELOCITY
public static final double DEFAULT_MAXIMUM_AT_REST_ANGULAR_VELOCITY
The default maximum angular velocity for aPhysicsBody
to be flagged as at-rest; in radians/second- Since:
- 4.0.0
-
DEFAULT_MINIMUM_AT_REST_TIME
public static final double DEFAULT_MINIMUM_AT_REST_TIME
The default required time aPhysicsBody
must maintain small motion to be flagged as at-rest; in seconds- Since:
- 4.0.0
- See Also:
- Constant Field Values
-
DEFAULT_SLEEP_LINEAR_VELOCITY
@Deprecated public static final double DEFAULT_SLEEP_LINEAR_VELOCITY
Deprecated.Deprecated in 4.0.0. UseDEFAULT_MAXIMUM_AT_REST_LINEAR_VELOCITY
instead.The default maximum velocity for aPhysicsBody
to go to sleep; in meters/second- See Also:
- Constant Field Values
-
DEFAULT_SLEEP_ANGULAR_VELOCITY
@Deprecated public static final double DEFAULT_SLEEP_ANGULAR_VELOCITY
Deprecated.Deprecated in 4.0.0. UseDEFAULT_MAXIMUM_AT_REST_ANGULAR_VELOCITY
instead.The default maximum angular velocity for aPhysicsBody
to go to sleep; in radians/second
-
DEFAULT_SLEEP_TIME
@Deprecated public static final double DEFAULT_SLEEP_TIME
Deprecated.Deprecated in 4.0.0. UseDEFAULT_MINIMUM_AT_REST_TIME
instead.The default required time aPhysicsBody
must maintain small motion so that its put to sleep; in seconds- See Also:
- Constant Field Values
-
DEFAULT_SOLVER_ITERATIONS
public static final int DEFAULT_SOLVER_ITERATIONS
The default number of solver iterations- See Also:
- Constant Field Values
-
DEFAULT_WARM_START_DISTANCE
@Deprecated public static final double DEFAULT_WARM_START_DISTANCE
Deprecated.Deprecated in 4.0.0. UseDEFAULT_MAXIMUM_WARM_START_DISTANCE
instead.The default warm starting distance; in meters2- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_WARM_START_DISTANCE
public static final double DEFAULT_MAXIMUM_WARM_START_DISTANCE
The default warm starting distance; in meters2- Since:
- 4.0.0
- See Also:
- Constant Field Values
-
DEFAULT_RESTITUTION_VELOCITY
public static final double DEFAULT_RESTITUTION_VELOCITY
The default restitution velocity; in meters/second- See Also:
- Constant Field Values
-
DEFAULT_LINEAR_TOLERANCE
public static final double DEFAULT_LINEAR_TOLERANCE
The default linear tolerance; in meters- See Also:
- Constant Field Values
-
DEFAULT_ANGULAR_TOLERANCE
public static final double DEFAULT_ANGULAR_TOLERANCE
The default angular tolerance; in radians
-
DEFAULT_MAXIMUM_LINEAR_CORRECTION
public static final double DEFAULT_MAXIMUM_LINEAR_CORRECTION
The default maximum linear correction; in meters- See Also:
- Constant Field Values
-
DEFAULT_MAXIMUM_ANGULAR_CORRECTION
public static final double DEFAULT_MAXIMUM_ANGULAR_CORRECTION
The default maximum angular correction; in radians
-
DEFAULT_BAUMGARTE
public static final double DEFAULT_BAUMGARTE
The default baumgarte- See Also:
- Constant Field Values
-
-
Method Detail
-
reset
public void reset()
Resets the settings back to defaults.
-
copy
public Settings copy()
Creates a deep copy of this settings object.- Returns:
Settings
- Since:
- 4.0.0
-
copy
public void copy(Settings settings)
Copies all the settings from the given settings to this settings.- Parameters:
settings
- the settings to copy- Since:
- 4.0.0
-
getStepFrequency
public double getStepFrequency()
Returns the step frequency of the dynamics engine in seconds.- Returns:
- double the step frequency
- See Also:
setStepFrequency(double)
-
setStepFrequency
public void setStepFrequency(double stepFrequency)
Sets the step frequency of the dynamics engine. This value determines how often to update the dynamics engine in seconds (every 1/60th of a second for example).Valid values are in the range (0, ∞] seconds.
Versions before 3.1.1 would convert the stepFrequency parameter from seconds-1 to seconds (60 to 1/60 for example) automatically. This automatic conversion has been removed in versions 3.1.1 and higher. Instead pass in the value in seconds (1/60 for example).
- Parameters:
stepFrequency
- the step frequency- Throws:
IllegalArgumentException
- if stepFrequency is less than or equal to zero
-
getMaximumTranslation
public double getMaximumTranslation()
Returns the maximum translation aPhysicsBody
can have in one time step.- Returns:
- double the maximum translation in meters
- See Also:
setMaximumTranslation(double)
-
getMaximumTranslationSquared
public double getMaximumTranslationSquared()
Returns the maximum translation squared.- Returns:
- double
- See Also:
getMaximumTranslation()
,setMaximumTranslation(double)
-
setMaximumTranslation
public void setMaximumTranslation(double maximumTranslation)
Sets the maximum translation aPhysicsBody
can have in one time step.Valid values are in the range [0, ∞] meters
- Parameters:
maximumTranslation
- the maximum translation- Throws:
IllegalArgumentException
- if maxTranslation is less than zero
-
getMaximumRotation
public double getMaximumRotation()
Returns the maximum rotation aPhysicsBody
can have in one time step.- Returns:
- double the maximum rotation in radians
- See Also:
setMaximumRotation(double)
-
getMaximumRotationSquared
public double getMaximumRotationSquared()
Returns the max rotation squared.- Returns:
- double
- See Also:
getMaximumRotation()
,setMaximumRotation(double)
-
setMaximumRotation
public void setMaximumRotation(double maximumRotation)
Sets the maximum rotation aPhysicsBody
can have in one time step.Valid values are in the range [0, ∞] radians
- Parameters:
maximumRotation
- the maximum rotation- Throws:
IllegalArgumentException
- if maxRotation is less than zero
-
isAutoSleepingEnabled
@Deprecated public boolean isAutoSleepingEnabled()
Deprecated.Deprecated in 4.0.0. UseisAtRestDetectionEnabled()
instead.Returns true if the engine automatically putsPhysicsBody
s to sleep.- Returns:
- boolean
-
setAutoSleepingEnabled
@Deprecated public void setAutoSleepingEnabled(boolean flag)
Deprecated.Deprecated in 4.0.0. UsesetAtRestDetectionEnabled(boolean)
instead.Sets whether the engine automatically putsPhysicsBody
s to sleep.- Parameters:
flag
- true ifPhysicsBody
s should be put to sleep automatically
-
isAtRestDetectionEnabled
public boolean isAtRestDetectionEnabled()
Returns true if the engine automatically flagsPhysicsBody
s as at-rest.- Returns:
- boolean
- Since:
- 4.0.0
-
setAtRestDetectionEnabled
public void setAtRestDetectionEnabled(boolean flag)
Sets whether the engine automatically flagsPhysicsBody
s as at-rest.- Parameters:
flag
- true ifPhysicsBody
s should be flagged as at-rest automatically- Since:
- 4.0.0
-
getSleepLinearVelocity
@Deprecated public double getSleepLinearVelocity()
Deprecated.Deprecated in 4.0.0. UsegetMaximumAtRestLinearVelocity()
instead.Returns the sleep linear velocity.- Returns:
- double the sleep velocity.
- See Also:
setSleepLinearVelocity(double)
-
getSleepLinearVelocitySquared
@Deprecated public double getSleepLinearVelocitySquared()
Deprecated.Deprecated in 4.0.0. UsegetMaximumAtRestLinearVelocitySquared()
instead.Returns the sleep linear velocity squared.- Returns:
- double
- See Also:
getSleepLinearVelocity()
,setSleepLinearVelocity(double)
-
setSleepLinearVelocity
@Deprecated public void setSleepLinearVelocity(double sleepLinearVelocity)
Deprecated.Deprecated in 4.0.0. UsesetMaximumAtRestLinearVelocity(double)
instead.Sets the sleep linear velocity.The sleep linear velocity is the maximum velocity a
PhysicsBody
can have to be put to sleep.Valid values are in the range [0, ∞] meters/second
- Parameters:
sleepLinearVelocity
- the sleep linear velocity- Throws:
IllegalArgumentException
- if sleepLinearVelocity is less than zero
-
getMaximumAtRestLinearVelocity
public double getMaximumAtRestLinearVelocity()
Returns the maximum at-rest linear velocity.- Returns:
- double the maximum at-rest velocity
- Since:
- 4.0.0
- See Also:
setSleepLinearVelocity(double)
-
getMaximumAtRestLinearVelocitySquared
public double getMaximumAtRestLinearVelocitySquared()
Returns the maximum at-rest linear velocity squared.- Returns:
- double
- Since:
- 4.0.0
- See Also:
getMaximumAtRestLinearVelocity()
,setSleepLinearVelocity(double)
-
setMaximumAtRestLinearVelocity
public void setMaximumAtRestLinearVelocity(double maximumAtRestLinearVelocity)
Sets the maximum at-rest linear velocity.The maximum at-rest linear velocity is the maximum linear velocity a
PhysicsBody
can have to be flagged as at-rest.Valid values are in the range [0, ∞] meters/second
- Parameters:
maximumAtRestLinearVelocity
- the maximum at-rest linear velocity- Throws:
IllegalArgumentException
- if maximumAtRestLinearVelocity is less than zero- Since:
- 4.0.0
-
getSleepAngularVelocity
@Deprecated public double getSleepAngularVelocity()
Deprecated.Deprecated in 4.0.0. UsegetMaximumAtRestAngularVelocity()
instead.Returns the sleep angular velocity.- Returns:
- double the sleep angular velocity.
- See Also:
setSleepAngularVelocity(double)
-
getSleepAngularVelocitySquared
@Deprecated public double getSleepAngularVelocitySquared()
Deprecated.Deprecated in 4.0.0. UsegetMaximumAtRestAngularVelocitySquared()
instead.Returns the sleep angular velocity squared.- Returns:
- double
- See Also:
getSleepAngularVelocity()
,setSleepAngularVelocity(double)
-
setSleepAngularVelocity
@Deprecated public void setSleepAngularVelocity(double sleepAngularVelocity)
Deprecated.Deprecated in 4.0.0. UsesetMaximumAtRestAngularVelocity(double)
instead.Sets the sleep angular velocity.The sleep angular velocity is the maximum angular velocity a
PhysicsBody
can have to be put to sleep.Valid values are in the range [0, ∞] radians/second
- Parameters:
sleepAngularVelocity
- the sleep angular velocity- Throws:
IllegalArgumentException
- if sleepAngularVelocity is less than zero
-
getMaximumAtRestAngularVelocity
public double getMaximumAtRestAngularVelocity()
Returns the maximum at-rest angular velocity.- Returns:
- double the maximum at-rest velocity
- Since:
- 4.0.0
- See Also:
setMaximumAtRestAngularVelocity(double)
-
getMaximumAtRestAngularVelocitySquared
public double getMaximumAtRestAngularVelocitySquared()
Returns the maximum at-rest angular velocity squared.- Returns:
- double
- Since:
- 4.0.0
- See Also:
getMaximumAtRestAngularVelocity()
,setMaximumAtRestAngularVelocity(double)
-
setMaximumAtRestAngularVelocity
public void setMaximumAtRestAngularVelocity(double maximumAtRestAngularVelocity)
Sets the maximum at-rest angular velocity.The maximum at-rest angular velocity is the maximum angular velocity a
PhysicsBody
can have to be flagged as at-rest.Valid values are in the range [0, ∞] meters/second
- Parameters:
maximumAtRestAngularVelocity
- the maximum at-rest angular velocity- Throws:
IllegalArgumentException
- if maximumAtRestAngularVelocity is less than zero- Since:
- 4.0.0
-
getSleepTime
@Deprecated public double getSleepTime()
Deprecated.Deprecated in 4.0.0. UsegetMinimumAtRestTime()
instead.Returns the sleep time.- Returns:
- double the sleep time
- See Also:
setSleepTime(double)
-
setSleepTime
@Deprecated public void setSleepTime(double sleepTime)
Deprecated.Deprecated in 4.0.0. UsesetMinimumAtRestTime(double)
instead.Sets the sleep time.The sleep time is the amount of time a body must be motionless before being put to sleep.
Valid values are in the range [0, ∞] seconds
- Parameters:
sleepTime
- the sleep time- Throws:
IllegalArgumentException
- if sleepTime is less than zero
-
getMinimumAtRestTime
public double getMinimumAtRestTime()
Returns the minimum time that aPhysicsBody
is motionless before being flagged as at-rest.- Returns:
- double the minimum at-rest time
- Since:
- 4.0.0
- See Also:
setMinimumAtRestTime(double)
-
setMinimumAtRestTime
public void setMinimumAtRestTime(double minimumAtRestTime)
Sets the minimum at-rest time.This is the minimum time a body must be motionless before being flagged as at-rest.
Valid values are in the range [0, ∞] seconds
- Parameters:
minimumAtRestTime
- the minimum at-rest time- Throws:
IllegalArgumentException
- if minimumAtRestTime is less than zero- Since:
- 4.0.0
-
getVelocityConstraintSolverIterations
public int getVelocityConstraintSolverIterations()
Returns the number of iterations used to solve velocity constraints.- Returns:
- int
-
setVelocityConstraintSolverIterations
public void setVelocityConstraintSolverIterations(int velocityConstraintSolverIterations)
Sets the number of iterations used to solve velocity constraints.Increasing the number will increase accuracy but decrease performance.
Valid values are in the range [1, ∞]
- Parameters:
velocityConstraintSolverIterations
- the number of iterations used to solve velocity constraints- Throws:
IllegalArgumentException
- if velocityConstraintSolverIterations is less than 5
-
getPositionConstraintSolverIterations
public int getPositionConstraintSolverIterations()
Returns the number of iterations used to solve position constraints.- Returns:
- int
-
setPositionConstraintSolverIterations
public void setPositionConstraintSolverIterations(int positionConstraintSolverIterations)
Sets the number of iterations used to solve position constraints.Increasing the number will increase accuracy but decrease performance.
Valid values are in the range [1, ∞]
- Parameters:
positionConstraintSolverIterations
- the number of iterations used to solve position constraints- Throws:
IllegalArgumentException
- if positionConstraintSolverIterations is less than 5
-
getWarmStartDistance
@Deprecated public double getWarmStartDistance()
Deprecated.Deprecated in 4.0.0. UsegetMaximumWarmStartDistance()
instead.Returns the warm start distance.- Returns:
- double the warm start distance
- See Also:
setWarmStartDistance(double)
-
getWarmStartDistanceSquared
@Deprecated public double getWarmStartDistanceSquared()
Deprecated.Deprecated in 4.0.0. UsegetMaximumWarmStartDistanceSquared()
instead.Returns the warm start distance squared.- Returns:
- double
- See Also:
getWarmStartDistance()
,setWarmStartDistance(double)
-
setWarmStartDistance
@Deprecated public void setWarmStartDistance(double warmStartDistance)
Deprecated.Deprecated in 4.0.0. UsesetMaximumWarmStartDistance(double)
instead.Sets the warm start distance.The maximum distance from one point to another to consider the points to be the same. This distance is used to determine if the points can carry over another point's accumulated impulses to be used for warm starting the constraint solver.
Valid values are in the range [0, ∞] meters
- Parameters:
warmStartDistance
- the warm start distance- Throws:
IllegalArgumentException
- if warmStartDistance is less than zero
-
getMaximumWarmStartDistance
public double getMaximumWarmStartDistance()
Returns the maximum warm start distance.- Returns:
- double the warm start distance
- See Also:
setMaximumWarmStartDistance(double)
-
getMaximumWarmStartDistanceSquared
public double getMaximumWarmStartDistanceSquared()
Returns the maximum warm start distance squared.- Returns:
- double
- See Also:
getMaximumWarmStartDistance()
,setMaximumWarmStartDistance(double)
-
setMaximumWarmStartDistance
public void setMaximumWarmStartDistance(double maximumWarmStartDistance)
Sets the maximum warm start distance.The maximum distance from one point to another to consider the points to be the same. This distance is used to determine if the points can carry over another point's accumulated impulses to be used for warm starting the constraint solver.
Valid values are in the range [0, ∞] meters
- Parameters:
maximumWarmStartDistance
- the maximum warm start distance- Throws:
IllegalArgumentException
- if warmStartDistance is less than zero
-
isWarmStartingEnabled
public boolean isWarmStartingEnabled()
Returns true if warm starting of contacts is enabled.- Returns:
- boolean
- Since:
- 4.0.0
- See Also:
setWarmStartingEnabled(boolean)
-
setWarmStartingEnabled
public void setWarmStartingEnabled(boolean flag)
Sets the warm starting of contacts to enabled.Warm starting of contacts is used to increase performance of contact constraint solving. Warm starting is the process of using the last frame's solver information to jump start the next.
- Parameters:
flag
- true if warm starting should be enabled- Since:
- 4.0.0
-
getRestitutionVelocity
public double getRestitutionVelocity()
Returns the restitution velocity.- Returns:
- double the restitution velocity
- See Also:
setRestitutionVelocity(double)
-
getRestitutionVelocitySquared
public double getRestitutionVelocitySquared()
Returns the restitution velocity squared.- Returns:
- double
- See Also:
getRestitutionVelocity()
,setRestitutionVelocity(double)
-
setRestitutionVelocity
public void setRestitutionVelocity(double restitutionVelocity)
Sets the restitution velocity.The relative velocity in the direction of the contact normal which determines whether to handle the collision as an inelastic or elastic collision.
Valid values are in the range [0, ∞] meters/second
- Parameters:
restitutionVelocity
- the restitution velocity- Throws:
IllegalArgumentException
- if restitutionVelocity is less than zero
-
getLinearTolerance
public double getLinearTolerance()
Returns the linear tolerance.- Returns:
- double the allowed penetration
- See Also:
setLinearTolerance(double)
-
getLinearToleranceSquared
public double getLinearToleranceSquared()
Returns the linear tolerance squared.- Returns:
- double
- See Also:
getLinearTolerance()
,setLinearTolerance(double)
-
setLinearTolerance
public void setLinearTolerance(double linearTolerance)
Sets the linear tolerance.Used to avoid jitter and facilitate stacking.
Valid values are in the range (0, ∞] meters
- Parameters:
linearTolerance
- the linear tolerance- Throws:
IllegalArgumentException
- if linearTolerance is less than zero
-
getAngularTolerance
public double getAngularTolerance()
Returns the angular tolerance.- Returns:
- double
- See Also:
setAngularTolerance(double)
-
getAngularToleranceSquared
public double getAngularToleranceSquared()
Returns the angular tolerance squared.- Returns:
- double
- See Also:
getAngularTolerance()
,setAngularTolerance(double)
-
setAngularTolerance
public void setAngularTolerance(double angularTolerance)
Sets the angular tolerance.Used to avoid jitter and facilitate stacking.
Valid values are in the range (0, ∞] radians
- Parameters:
angularTolerance
- the angular tolerance- Throws:
IllegalArgumentException
- if angularTolerance is less than zero
-
getMaximumLinearCorrection
public double getMaximumLinearCorrection()
Returns the maximum linear correction.- Returns:
- double the maximum linear correction
- See Also:
setMaximumLinearCorrection(double)
-
getMaximumLinearCorrectionSquared
public double getMaximumLinearCorrectionSquared()
Returns the maximum linear correction squared.- Returns:
- double
- See Also:
getMaximumLinearCorrection()
,setMaximumLinearCorrection(double)
-
setMaximumLinearCorrection
public void setMaximumLinearCorrection(double maximumLinearCorrection)
Sets the maximum linear correction.The maximum linear correction used when estimating the current penetration depth during the position constraint solving step.
This is used to avoid large corrections.
Valid values are in the range (0, ∞] meters
- Parameters:
maximumLinearCorrection
- the maximum linear correction- Throws:
IllegalArgumentException
- if maxLinearCorrection is less than zero
-
getMaximumAngularCorrection
public double getMaximumAngularCorrection()
Returns the maximum angular correction.- Returns:
- double
- See Also:
setMaximumAngularCorrection(double)
-
getMaximumAngularCorrectionSquared
public double getMaximumAngularCorrectionSquared()
Returns the maximum angular correction squared.- Returns:
- double
- See Also:
getMaximumAngularCorrection()
,setMaximumAngularCorrection(double)
-
setMaximumAngularCorrection
public void setMaximumAngularCorrection(double maximumAngularCorrection)
Sets the maximum angular correction.This is used to prevent large angular corrections.
Valid values are in the range [0, ∞] radians
- Parameters:
maximumAngularCorrection
- the maximum angular correction- Throws:
IllegalArgumentException
- if maxAngularCorrection is less than zero
-
getBaumgarte
public double getBaumgarte()
Returns the baumgarte factor.- Returns:
- double baumgarte
- See Also:
setBaumgarte(double)
-
setBaumgarte
public void setBaumgarte(double baumgarte)
Sets the baumgarte factor.The position correction bias factor that determines the rate at which the position constraints are solved.
Valid values are in the range [0, ∞].
- Parameters:
baumgarte
- the baumgarte factor- Throws:
IllegalArgumentException
- if baumgarte is less than zero
-
getContinuousDetectionMode
public ContinuousDetectionMode getContinuousDetectionMode()
Returns the continuous collision detection mode.- Returns:
ContinuousDetectionMode
- Since:
- 2.2.3
-
setContinuousDetectionMode
public void setContinuousDetectionMode(ContinuousDetectionMode mode)
Sets the continuous collision detection mode.- Parameters:
mode
- the CCD mode- Throws:
NullPointerException
- if mode is null- Since:
- 2.2.3
-
-