class nape.Config
Available on all platforms
Configuration parameters for Nape
Class Fields
static var angularCCDSlipScale:Float
Angular velocity scaling during CCD slips.
*
* In rare cases, a Body can be moving in such a way that we fail to compute a perfect
* time of impact; generally when a thin box-like object is rotating very quickly. The
* time of impact solver in Nape attempts to avoid impacts which are seperating; so that
* we can catch true impact times; but in a 'slip' case we are unable to achieve this and
* to avoid a possible tunneling from the other side during later operations we will in
* these rare cases scale down the angular velocity of a Body by this parameter.
*
* This parameter has no units.
* @default 0.75
static var angularSleepThreshold:Float
Angular speed threshold for sleeping of Bodies.
*
* A body in Nape will be considered stationary only if its angular velocity, multiplied
* by the body radius (never under-estimated) about the origin, falls below this threshold.
*
* The body radius scaling, ensures that a very large body needs to be rotating more slowly
* to be considered stationary than a very small body. Intuitively we're designating this
* a threshold on the maximum tangentenial velocity of the body due to rotation.
*
* This parameter has units of px.rad/s
* @default 0.4px.rad/s
static var arbiterExpirationDelay:Int
Expiration delay length for collision arbiter destruction.
*
* In unstable physics conditions, two colliding shapes may jitter such as to constantly
* seperate, and then come back together again. This parameter controls the number of time
* steps during which we will delay this destruction so that cached impulse values may
* persist and improve stability of strenuous simulations.
*
* This parameter has units of 'steps' I suppose.
* @default 6steps
static var bulletCCDAngularThreshold:Float
Angular sweep threshold for bullet CCD collisions.
*
* See description of bulletCCDLinearThreshold.
*
* This parameter has units of rad.
* @default 0.0125rad
static var bulletCCDLinearThreshold:Float
Linear sweep threshold-ratio for bullet CCD collisions
*
* A dynamic body marked as a bullet, will not necessarigly always be collided
* with continuously.
*
* Should a body be moving, or rotating fast enough to pass the tests determined
* by staticCCD#Threshold parameters, and is marked as a bullet, it must then
* have its velocities checked against the equivalent bullet thresholds to actually
* be collided continuously against other dynamic bodies too.
*
* This parameter has no units.
* @default 0.125
static var collisionSlop:Float
Amount of overlap permitted between Shapes for collisions.
*
* This parameter has units of pixels.
* @default 0.2px
static var collisionSlopCCD:Float
Amount of overlap permitted between Shapes before CCD kicks in.
*
* This parameter has units of pixels, and should always be larger
* than collisionSlop parameter.
* @default 0.5px
static var constraintAngularSlop:Float
Amount of angular slop permitted in constraints.
*
* A constraint will be considered to be 'relaxed' during positional iterations
* only if the angular error falls below this threshold.
*
* Assuming a 'sensible' constraint, this has units of rad
* @default 1e-3rad
static var constraintLinearSlop:Float
Amount of linear slop permitted in constraints.
*
* A constraint will be considered to be 'relaxed' during positional iterations
* only if the linear error falls below this threshold.
*
* Assuming a 'sensible' constraint, this has units of px
* @default 0.1px
static var contactBiasCoef:Float
Fraction of contact slop resolved per-step for dynamic-dynamic discrete collisions.
*
* This value determines, in the case of two non-continuously colliding dynamic objects
* the fraction of the contact overlap that will attempt to be resolved during positional
* iterations.
*
* This parameter has units of 1/'step' I suppose.
* @default 0.3/step
static var contactContinuousBiasCoef:Float
Fraction of contact slop resolved per-step for dynamic-dynamic continuous collisions.
*
* See description of contactBiasCoef; this is the coeffecient for continuous collisions
* between two dynamic bodies.
*
* This parameter has units of 1/'step' I suppose.
* @default 0.4/step
static var contactContinuousStaticBiasCoef:Float
Fraction of contact slop resolved per-step for static/kinematic continuous collisions.
*
* See description of contactBiasCoef; this is the coeffecient for continuous collisions
* between a dynamic, and a static or kinematic object.
*
* This parameter has units of 1/'step' I suppose.
* @default 0.5/step
static var contactStaticBiasCoef:Float
Fraction of contact slop resolved per-step for static/kinematic discrete collisions.
*
* See description of contactBiasCoef; this is the coeffecient for non-continuous collisions
* between a dynamic, and a static or kinematic object.
*
* This parameter has units of 1/'step' I suppose.
* @default 0.6/step
static var distanceThresholdCCD:Float
Biased distance treshold for CCD collisions.
*
* In CCD collision routines, two Shapes will be considered intersecting
* when the distance between them + collisionSlopCCD falls below this
* value.
*
* This parameter has units of pixels, and should always be > 0
* @default 0.05px
static var dynamicSweepAngularThreshold:Float
Relative angular bias threshold for dynamic-dynamic sweeps.
*
* When performing dynamic-dynamic sweep of Body shapes during CCD collision phase,
* should the relative angular velocity (weighted by the shape bias values) fall
* beneath this magnitude, they may be considered (based on linear velocities also) to
* be moving together, and this specific CCD test will be skipped.
*
* The shape bias, is an internal value which indicates the 'amount of radius' of
* a shape about the centre of rotation that can be considered to change under rotations.
* eg: A circle at origin has a bias of 0 (Its rotation has no effect on sweeps)
* whilst A circle far from the origin may have a large bias.
*
* This parameter has units of px.rad/s
* @default 0.6px.rad/s
static var dynamicSweepLinearThreshold:Float
Relative linear threshold for dynamic-dynamic sweeps.
*
* When performing dynamic-dynamic sweep of Body shapes during CCD collision phase,
* should the relative velocity of the bodies fall beneath this magnitude, they
* may be considered (based on angular velocities also) to be moving together, and
* this specific CCD test will be skipped.
*
* This parameter has units of px/s
* @default 17px/s
static var elasticThreshold:Float
Contact velocity threshold for elastic collisions
*
* This is the threshold on weighted projected normal-contact velocities at which Nape will
* decide to stop using elastic collisions. Nape will take the normal velocities at contact
* and scale by the combined elasticity coeffecient for the Arbiter, if this value falls
* below the threshold, then elasticity is ignored for stability in stacking.
*
* This parameter has units of px/s
* @default 20px/s
static var fluidAngularDrag:Float
Parameter used in computing shape fluid angular drag coeffecient.
*
* Defines the contribution to the drag coeffecient due to shape's surface
* area rotating into a fluid.
*
* This global value must be set as the very first thing to ensure all Shapes
* use your intended value.
*
* This parameter has units kg/px
* @default 100kg/px
static var fluidAngularDragFriction:Float
Parameter used in computing shape fluid angular drag coeffecient.
*
* Defines the contribution to the drag coeffecient due to Material dynamicFriction
*
* This global value must be set as the very first thing to ensure all Shapes
* use your intended value.
*
* This parameter has units kg/px
* @default 2.5 kg/px
static var fluidLinearDrag:Float
Parameter used in computing shapes linear drag in fluid.
*
* Used in determining the amount of linear drag for the shape based on forward profile.
*
* This parameter has units kg/px
* @default 0.5kg/px
static var fluidVacuumDrag:Float
Parameter used in computing fluid drags.
*
* Defines an added weight for scaling the contribution of forward drag due
* to leaving a vaccuum behind the shape pulling it back.
*
* This global value must be set as the very first thing to ensure all Shapes
* use your intended value.
*
* This parameter has no units.
* @default 0.5
static var illConditionedThreshold:Float
Ill-conditioned threshold for 2-contact collision constraints.
*
* This is a threshold on the measure of ill-conditioning of the effective-mass-matrix
* in a 2-contact collision at which the contact manifold will be forced into a 1-contact
* constraint. This can occur quite readily when two contact points are almost exactly equal
* or in certain other conditions where the mathematics quite simply breaks down when using
* a block solver.
*
* This parameter has no units.
* @default 2e+8
static var linearSleepThreshold:Float
Linear speed threshold for sleeping of Bodies.
*
* A body in Nape will be considered stationary only if its linear velocity has magnitude
* under this threshold.
*
* This parameter has units of px/s
* @default 0.2px/s
static var sleepDelay:Int
Sleep delay for stationary bodies.
*
* By default, Nape considers a body to be stationary even if it has a very small linear
* or angular velocity. This parameter controls how many steps such a Body will continue
* to be simulated for, before being put to sleep (Assuming everything else in the island
* is also stationary for a sufficiently long time).
*
* This parameter has units of 'steps' I suppose.
* @default 60steps
static var staticCCDAngularThreshold:Float
Angular sweep threshold for static CCD collisions
*
* In deciding what non-bullet objects should be collided continuously against
* static/kinematic objects, the angular speed of the body is considered.
*
* ccdCollide if: bodyAngularSpeed * deltaTime > threshold
*
* Intuitively, a value of 0.5 would mean that a body would have to rotate more than
* 0.5 radians in a single time step, before CCD is enabled for this reason. Noting that
* at 60fps physics, the body would need an angularVel greater than 30rad/s for this
* limit of 0.5 to be reached; the default is far smaller.
*
* This parameter has units of rad.
* @default 0.005rad
static var staticCCDLinearThreshold:Float
Linear sweep threshold-ratio for static CCD collisions
*
* In deciding what non-bullet objects should be collided continuously against
* static/kinematic objects, the linear speed of the body is considered.
*
* ccdCollide if: bodyLinearSpeed * deltaTime > threshold * bodyRadius
*
* Intuitively, a value of 0.5 would mean that a body, in the worst case scenario
* will be permitted to move half of its width in a single time step, before CCD
* is enabled for this reason.
*
* This parameter has no units.
* @default 0.05
static var staticFrictionThreshold:Float
Contact velocity threshold for static-dynamic friction
*
* This is the threshold on projected contact velocities at which Nape will use
* dynamic friction Mateiral values, in place of static friction Material values.
*
* This parameter has units of px/s
* @default 2px/s