Options
All
  • Public
  • Public/Protected
  • All
Menu

Controls Box2D global settings.

Hierarchy

  • b2Settings

Index

Constructors

constructor

Properties

Static USHRT_MAX

USHRT_MAX: number

Maximum unsigned short value.

Static VERSION

VERSION: string

The current version of Box2D.

Static b2_aabbExtension

b2_aabbExtension: number

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 b2_aabbMultiplier

b2_aabbMultiplier: number

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 b2_angularSleepTolerance

b2_angularSleepTolerance: number

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

Static b2_angularSlop

b2_angularSlop: number

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

Static b2_contactBaumgarte

b2_contactBaumgarte: number

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 b2_linearSleepTolerance

b2_linearSleepTolerance: number

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

Static b2_linearSlop

b2_linearSlop: number

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

Static b2_maxAngularCorrection

b2_maxAngularCorrection: number

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

Static b2_maxLinearCorrection

b2_maxLinearCorrection: number

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

Static b2_maxManifoldPoints

b2_maxManifoldPoints: number

Number of manifold points in a b2Manifold. This should NEVER change.

Static b2_maxRotation

b2_maxRotation: number

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

Static b2_maxRotationSquared

b2_maxRotationSquared: number

b2_maxRotation squared

Static b2_maxTOIContactsPerIsland

b2_maxTOIContactsPerIsland: number

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

Static b2_maxTOIJointsPerIsland

b2_maxTOIJointsPerIsland: number

Maximum number of joints to be handled to solve a TOI island.

Static b2_maxTranslation

b2_maxTranslation: number

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

Static b2_maxTranslationSquared

b2_maxTranslationSquared: number

b2_maxTranslation squared

Static b2_pi

b2_pi: number

3.141592653589793

Static b2_polygonRadius

b2_polygonRadius: number

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

Static b2_timeToSleep

b2_timeToSleep: number

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

Static b2_toiSlop

b2_toiSlop: number

Continuous collision detection (CCD) works with core, shrunken shapes. This is the amount by which shapes are automatically shrunk to work with CCD. This must be larger than b2_linearSlop.

see

also b2_linearSlop

Static b2_velocityThreshold

b2_velocityThreshold: number

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

Methods

Static b2Assert

  • b2Assert(a: boolean): void
  • b2Assert is used internally to handle assertions. By default, calls are commented out to save performance, so they serve more as documentation than anything else.

    Parameters

    • a: boolean

      Asset an expression is true.

    Returns void

Static b2MixFriction

  • b2MixFriction(friction1: number, friction2: number): number
  • Friction mixing law. Feel free to customize this. Friction values are usually set between 0 and 1. (0 = no friction, 1 = high friction) By default this is return Math.sqrt(friction1, friction2);

    Parameters

    • friction1: number

      Friction 1 to mix.

    • friction2: number

      Friction 2 to mix.

    Returns number

    The two frictions mixed as one value.

Static b2MixRestitution

  • b2MixRestitution(restitution1: number, restitution2: number): number
  • Restitution mixing law. Feel free to customize this. Restitution is used to make objects bounce. Restitution values are usually set between 0 and 1. (0 = no bounce (inelastic), 1 = perfect bounce (perfectly elastic)) By default this is return Math.Max(restitution1, restitution2);

    Parameters

    • restitution1: number

      Restitution 1 to mix.

    • restitution2: number

      Restitution 2 to mix.

    Returns number

    The two restitutions mixed as one value.

Generated using TypeDoc