2021-05-11 18:30:36 -07:00

8.9 KiB
Raw Permalink Blame History

Planck.js API Doc › Globals › Settings

Class: Settings

Tuning constants based on meters-kilograms-seconds (MKS) units.

Hierarchy

  • Settings

Index

Properties

Accessors

Properties

Static aabbExtension

▪ aabbExtension: number = 0.1

Defined in src/Settings.ts:49

This 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.


Static aabbMultiplier

▪ aabbMultiplier: number = 2

Defined in src/Settings.ts:56

This 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.


Static angularSleepTolerance

▪ angularSleepTolerance: number = (2.0 / 180.0 * Math.PI)

Defined in src/Settings.ts:157

A body cannot sleep if its angular velocity is above this tolerance.


Static angularSlop

▪ angularSlop: number = (2.0 / 180.0 * Math.PI)

Defined in src/Settings.ts:69

A small angle used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant.


Static baumgarte

▪ baumgarte: number = 0.2

Defined in src/Settings.ts:138

This 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.


Static linearSleepTolerance

▪ linearSleepTolerance: number = 0.01

Defined in src/Settings.ts:151

A body cannot sleep if its linear velocity is above this tolerance.


Static linearSlop

▪ linearSlop: number = 0.005

Defined in src/Settings.ts:62

A small length used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant.


Static maxAngularCorrection

▪ maxAngularCorrection: number = (8.0 / 180.0 * Math.PI)

Defined in src/Settings.ts:117

The maximum angular position correction used when solving constraints. This helps to prevent overshoot.


Static maxDistnceIterations

▪ maxDistnceIterations: number = 20

Defined in src/Settings.ts:99

Maximum iterations to find Distance.


Static maxLinearCorrection

▪ maxLinearCorrection: number = 0.2

Defined in src/Settings.ts:111

The maximum linear position correction used when solving constraints. This helps to prevent overshoot.


Static maxManifoldPoints

▪ maxManifoldPoints: number = 2

Defined in src/Settings.ts:37

The maximum number of contact points between two convex shapes. Do not change this value.


Static maxPolygonVertices

▪ maxPolygonVertices: number = 12

Defined in src/Settings.ts:43

The maximum number of vertices on a convex polygon. You cannot increase this too much because BlockAllocator has a maximum object size.


Static maxRotation

▪ maxRotation: number = (0.5 * Math.PI)

Defined in src/Settings.ts:130

The maximum angular velocity of a body. This limit is very large and is used to prevent numerical problems. You shouldn't need to adjust Settings.


Static maxSubSteps

▪ maxSubSteps: number = 8

Defined in src/Settings.ts:82

Maximum number of sub-steps per contact in continuous physics simulation.


Static maxTOIContacts

▪ maxTOIContacts: number = 32

Defined in src/Settings.ts:89

Maximum number of contacts to be handled to solve a TOI impact.


Static maxTOIIterations

▪ maxTOIIterations: number = 20

Defined in src/Settings.ts:94

Maximum iterations to solve a TOI.


Static maxTranslation

▪ maxTranslation: number = 2

Defined in src/Settings.ts:123

The maximum linear velocity of a body. This limit is very large and is used to prevent numerical problems. You shouldn't need to adjust Settings.


Static timeToSleep

▪ timeToSleep: number = 0.5

Defined in src/Settings.ts:146

The time that a body must be still before it will go to sleep.


Static toiBaugarte

▪ toiBaugarte: number = 0.75

Defined in src/Settings.ts:139


Static velocityThreshold

▪ velocityThreshold: number = 1

Defined in src/Settings.ts:105

A velocity threshold for elastic collisions. Any collision with a relative linear velocity below this threshold will be treated as inelastic.

Accessors

Static angularSleepToleranceSqr

• get angularSleepToleranceSqr(): number

Defined in src/Settings.ts:158

Returns: number


Static linearSleepToleranceSqr

• get linearSleepToleranceSqr(): number

Defined in src/Settings.ts:152

Returns: number


Static linearSlopSquared

• get linearSlopSquared(): number

Defined in src/Settings.ts:63

Returns: number


Static maxRotationSquared

• get maxRotationSquared(): number

Defined in src/Settings.ts:131

Returns: number


Static maxTranslationSquared

• get maxTranslationSquared(): number

Defined in src/Settings.ts:124

Returns: number


Static polygonRadius

• get polygonRadius(): number

Defined in src/Settings.ts:77

The radius of the polygon/edge shape skin. This should not be modified. Making this smaller means polygons will have an insufficient buffer for continuous collision. Making it larger may create artifacts for vertex collision.

Returns: number