Configuration parameters for Nape

Static variables

staticangularCCDSlipScale:Float = 0.75

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.

staticangularSleepThreshold:Float = 0.4

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

staticarbiterExpirationDelay:Int = 6

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.

staticbulletCCDAngularThreshold:Float = 0.0125

Angular sweep threshold for bullet CCD collisions.

See description of bulletCCDLinearThreshold.

This parameter has units of rad.

staticbulletCCDLinearThreshold:Float = 0.125

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.

staticcollisionSlop:Float = 0.2

Amount of overlap permitted between Shapes for collisions.

This parameter has units of pixels.

staticcollisionSlopCCD:Float = 0.5

Amount of overlap permitted between Shapes before CCD kicks in.

This parameter has units of pixels, and should always be larger than collisionSlop parameter.

staticconstraintAngularSlop:Float = 1e-3

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

staticconstraintLinearSlop:Float = 0.1

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

staticcontactBiasCoef:Float = 0.3

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.

staticcontactContinuousBiasCoef:Float = 0.4

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.

staticcontactContinuousStaticBiasCoef:Float = 0.5

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.

staticcontactStaticBiasCoef:Float = 0.6

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.

staticdistanceThresholdCCD:Float = 0.05

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

staticdynamicSweepAngularThreshold:Float = 0.6

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

staticdynamicSweepLinearThreshold:Float = 17

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

staticelasticThreshold:Float = 20

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

staticepsilon:Float = 1e-8

Generic epsilon value for float comparisons

staticfluidAngularDrag:Float = 100

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

staticfluidAngularDragFriction:Float = 2.5

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

staticfluidLinearDrag:Float = 0.5

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

staticfluidVacuumDrag:Float = 0.5

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.

staticillConditionedThreshold:Float = 2e+8

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.

staticlinearSleepThreshold:Float = 0.2

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

staticsleepDelay:Int = 60

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.

staticstaticCCDAngularThreshold:Float = 0.005

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.

staticstaticCCDLinearThreshold:Float = 0.05

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.

staticstaticFrictionThreshold:Float = 2

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