public class Settings
- Object
- Settings
Global tuning constants based on MKS units and various integer maximums (vertices per shape,
pairs, etc.).
Fields
Constructors
public Settings() |
Methods
public static final float mixFriction(float friction1, float friction2) | Friction mixing law. |
public static final float mixRestitution(float restitution1, float restitution2) | Restitution mixing law. |
Inherited methods
Field details
EPSILON
public static final float EPSILON = 1.1920929E-7fA “close to zero” float epsilon value for use
PI
public static final float PI = 3.1415927fPi.
FAST_ABS
public static boolean FAST_ABSFAST_FLOOR
public static boolean FAST_FLOORFAST_CEIL
public static boolean FAST_CEILFAST_ROUND
public static boolean FAST_ROUNDFAST_ATAN2
public static boolean FAST_ATAN2CONTACT_STACK_INIT_SIZE
public static int CONTACT_STACK_INIT_SIZESINCOS_LUT_ENABLED
public static boolean SINCOS_LUT_ENABLEDSINCOS_LUT_PRECISION
public static final float SINCOS_LUT_PRECISION = 1.1E-4fsmaller the precision, the larger the table. If a small table is used (eg, precision is .006 or
greater), make sure you set the table to lerp it’s results. Accuracy chart is in the MathUtils
source. Or, run the tests yourself in SinCosTest.
Good lerp precision values:
.0092
.008201
.005904
.005204
.004305
.002807
.001508
9.32500E-4
7.48000E-4
8.47000E-4
.0005095
.0001098
9.50499E-5
6.08500E-5
3.07000E-5
1.53999E-5
SINCOS_LUT_LENGTH
public static final int SINCOS_LUT_LENGTHSINCOS_LUT_LERP
public static boolean SINCOS_LUT_LERPUse if the table’s precision is large (eg .006 or greater). Although it is more expensive, it
greatly increases accuracy. Look in the MathUtils source for some test results on the accuracy
and speed of lerp vs non lerp. Or, run the tests yourself in
SinCosTest.maxManifoldPoints
public static final int maxManifoldPoints = 2The maximum number of contact points between two convex shapes.
maxPolygonVertices
public static final int maxPolygonVertices = 8The maximum number of vertices on a convex polygon.
aabbExtension
public static final float aabbExtension = 0.1fThis is used to fatten AABBs in the dynamic tree. This allows proxies to move by a small amount
without triggering a tree adjustment. This is in meters.
aabbMultiplier
public static final float aabbMultiplier = 2.0fThis is used to fatten AABBs in the dynamic tree. This is used to predict the future position
based on the current displacement. This is a dimensionless multiplier.
linearSlop
public static final float linearSlop = 0.005fA small length used as a collision and constraint tolerance. Usually it is chosen to be
numerically significant, but visually insignificant.
angularSlop
public static final float angularSlop = 0.03490659fA small angle used as a collision and constraint tolerance. Usually it is chosen to be
numerically significant, but visually insignificant.
polygonRadius
public static final float polygonRadius = 0.01fThe radius of the polygon/edge shape skin. This should not be modified. Making this smaller
means polygons will have and insufficient for continuous collision. Making it larger may create
artifacts for vertex collision.
maxSubSteps
public static final int maxSubSteps = 8Maximum number of sub-steps per contact in continuous physics simulation.
maxTOIContacts
public static final int maxTOIContacts = 32Maximum number of contacts to be handled to solve a TOI island.
velocityThreshold
public static final float velocityThreshold = 1.0fA velocity threshold for elastic collisions. Any collision with a relative linear velocity
below this threshold will be treated as inelastic.
maxLinearCorrection
public static final float maxLinearCorrection = 0.2fThe maximum linear position correction used when solving constraints. This helps to prevent
overshoot.
maxAngularCorrection
public static final float maxAngularCorrection = 0.13962635fThe maximum angular position correction used when solving constraints. This helps to prevent
overshoot.
maxTranslation
public static final float maxTranslation = 2.0fThe maximum linear velocity of a body. This limit is very large and is used to prevent
numerical problems. You shouldn’t need to adjust this.
maxTranslationSquared
public static final float maxTranslationSquared = 4.0fmaxRotation
public static final float maxRotation = 1.5707964fThe maximum angular velocity of a body. This limit is very large and is used to prevent
numerical problems. You shouldn’t need to adjust this.
maxRotationSquared
public static float maxRotationSquaredbaumgarte
public static final float baumgarte = 0.2fThis scale factor controls how fast overlap is resolved. Ideally this would be 1 so that
overlap is removed in one time step. However using values close to 1 often lead to overshoot.
toiBaugarte
public static final float toiBaugarte = 0.75ftimeToSleep
public static final float timeToSleep = 0.5fThe time that a body must be still before it will go to sleep.
linearSleepTolerance
public static final float linearSleepTolerance = 0.01fA body cannot sleep if its linear velocity is above this tolerance.
angularSleepTolerance
public static final float angularSleepTolerance = 0.03490659fA body cannot sleep if its angular velocity is above this tolerance.
Constructor details
Settings
public Settings()Method details
mixFriction
public static final float mixFriction(float friction1, float friction2)Friction mixing law. Feel free to customize this. TODO djm: add customization
mixRestitution
public static final float mixRestitution(float restitution1, float restitution2)Restitution mixing law. Feel free to customize this. TODO djm: add customization