Class Common
public static class Common
Namespace Engine4.Physics
Inheritance
Fields
ALLOW_SLEEP
Enables or disables rigid body sleeping. It's an important optimization on every physics engine. It's recommended to leave this on.
public const bool ALLOW_SLEEP = true
BAUMGARTE
How fast the collision must be resolved? (Default is 0.2)
public const float BAUMGARTE = 0.2F
ENABLE_FRICTION
When two objects lay on each other should the simulator simulate friction? It's recommended to leave this on.
public const bool ENABLE_FRICTION = true
GRAVITY
Default gravity for all simulations. This parameter can be dynamically adjusted.
public static Vector4 GRAVITY
ITERATIONS
Constant collision solving iteration. Higher values are more realistic, yet more expensive. Default is 15, can be put between 5 to 20
public const int ITERATIONS = 15
MAX_DT
Maximum allowed delta time. This prevents objects bypassing each other because of too large delta time. (Default is 0.02)
public const float MAX_DT = 0.02F
MULTICONTACT_COUNT
Constant maximum multi contact count. Don't change.
public const int MULTICONTACT_COUNT = 16
PENETRATION_SLOP
Offset of allowed contact depth before kicked out by the solver. Allow very small number to avoid jitter. (Default is 0.05)
public const float PENETRATION_SLOP = 0.02F
SIM_RANGE
Simulation range helps to avoid wasted time computation of computing Objects that out of range (e.g. object keeps falling down). The object is deactivated once becomes so.
public static readonly Bounds4 SIM_RANGE
SLEEP_ANGULAR
Maximum allowed angular velocity that makes a rigidbody sleeps (Default is 2 deg)
public const float SLEEP_ANGULAR = 0.0349065848F
SLEEP_LINEAR
Maximum allowed linear velocity that makes a rigidbody sleeps (Default is 0.01)
public const float SLEEP_LINEAR = 0.01F
SLEEP_TIME
Simulator don't make rigidbody sleeps instantly. They have a chance by given time to awake by itself. (Default is 0.5)
public const float SLEEP_TIME = 0.5F
Methods
MixFriction(Shape, Shape)
Friction (slide) mixing. Default is average
public static float MixFriction(Shape A, Shape B)
MixRestitution(Shape, Shape)
Restitution (bounce) mixing. Default is max
public static float MixRestitution(Shape A, Shape B)