/// If objects are closer than this distance, they are considered to be colliding (used for GJK) (unit: meter)
constexprfloatcDefaultCollisionTolerance=1.0e-4f;
/// A factor that determines the accuracy of the penetration depth calculation. If the change of the squared distance is less than tolerance * current_penetration_depth^2 the algorithm will terminate. (unit: dimensionless)
constexprfloatcDefaultPenetrationTolerance=1.0e-4f;///< Stop when there's less than 1% change
/// How much padding to add around objects
constexprfloatcDefaultConvexRadius=0.05f;
/// Used by (Tapered)CapsuleShape to determine when supporting face is an edge rather than a point (unit: meter)
staticconstexprfloatcCapsuleProjectionSlop=0.02f;
/// Maximum amount of jobs to allow
constexprintcMaxPhysicsJobs=2048;
/// Maximum amount of barriers to allow
constexprintcMaxPhysicsBarriers=8;
structPhysicsSettings
{
JPH_OVERRIDE_NEW_DELETE
/// Size of body pairs array, corresponds to the maximum amount of potential body pairs that can be in flight at any time.
/// Setting this to a low value will use less memory but slow down simulation as threads may run out of narrow phase work.
intmMaxInFlightBodyPairs=16384;
/// How many PhysicsStepListeners to notify in 1 batch
intmStepListenersBatchSize=8;
/// How many step listener batches are needed before spawning another job (set to INT_MAX if no parallelism is desired)
intmStepListenerBatchesPerJob=1;
/// Baumgarte stabilization factor (how much of the position error to 'fix' in 1 update) (unit: dimensionless, 0 = nothing, 1 = 100%)
floatmBaumgarte=0.2f;
/// Radius around objects inside which speculative contact points will be detected. Note that if this is too big
/// you will get ghost collisions as speculative contacts are based on the closest points during the collision detection
/// step which may not be the actual closest points by the time the two objects hit (unit: meters)
floatmSpeculativeContactDistance=0.02f;
/// How much bodies are allowed to sink into each other (unit: meters)
floatmPenetrationSlop=0.02f;
/// Fraction of its inner radius a body must move per step to enable casting for the LinearCast motion quality
floatmLinearCastThreshold=0.75f;
/// Fraction of its inner radius a body may penetrate another body for the LinearCast motion quality
/// By default the simulation is deterministic, it is possible to turn this off by setting this setting to false. This will make the simulation run faster but it will no longer be deterministic.
boolmDeterministicSimulation=true;
///@name These variables are mainly for debugging purposes, they allow turning on/off certain subsystems. You probably want to leave them alone.
///@{
/// Whether or not to use warm starting for constraints (initially applying previous frames impulses)
boolmConstraintWarmStart=true;
/// Whether or not to use the body pair cache, which removes the need for narrow phase collision detection when orientation between two bodies didn't change
boolmUseBodyPairContactCache=true;
/// Whether or not to reduce manifolds with similar contact normals into one contact manifold (see description at Body::SetUseManifoldReduction)
boolmUseManifoldReduction=true;
/// If we split up large islands into smaller parallel batches of work (to improve performance)
boolmUseLargeIslandSplitter=true;
/// If objects can go to sleep or not
boolmAllowSleeping=true;
/// When false, we prevent collision against non-active (shared) edges. Mainly for debugging the algorithm.