PackageBox2D.Common
Classpublic class b2Settings
Sourceb2Settings.as

This class controls Box2D global settings



Public Methods
 MethodDefined by
  
b2Assert(a:Boolean):void
[static] b2Assert is used internally to handle assertions.
b2Settings
  
b2MixFriction(friction1:Number, friction2:Number):Number
[static] Friction mixing law.
b2Settings
  
b2MixRestitution(restitution1:Number, restitution2:Number):Number
[static] Restitution mixing law.
b2Settings
Public Constants
 ConstantDefined by
  b2_angularSleepTolerance : Number = 0.011111111111111112
[static] A body cannot sleep if its angular velocity is above this tolerance.
b2Settings
  b2_angularSlop : Number
[static] A small angle used as a collision and constraint tolerance.
b2Settings
  b2_contactBaumgarte : Number = 0.2
[static] This scale factor controls how fast overlap is resolved.
b2Settings
  b2_linearSleepTolerance : Number = 0.01
[static] A body cannot sleep if its linear velocity is above this tolerance.
b2Settings
  b2_linearSlop : Number = 0.005
[static] A small length used as a collision and constraint tolerance.
b2Settings
  b2_maxAngularCorrection : Number
[static] The maximum angular position correction used when solving constraints.
b2Settings
  b2_maxAngularVelocity : Number = 250.0
[static] The maximum angular velocity of a body.
b2Settings
  b2_maxAngularVelocitySquared : Number = 62500.0
[static]
b2Settings
  b2_maxLinearCorrection : Number = 0.2
[static] The maximum linear position correction used when solving constraints.
b2Settings
  b2_maxLinearVelocity : Number = 200.0
[static] The maximum linear velocity of a body.
b2Settings
  b2_maxLinearVelocitySquared : Number = 40000.0
[static]
b2Settings
  b2_maxManifoldPoints : int = 2
[static] Number of manifold points in a b2Manifold.
b2Settings
  b2_maxPolygonVertices : int = 8
[static] The maximun allowed vertices in a polygon.
b2Settings
  b2_maxTOIContactsPerIsland : int = 32
[static] Maximum number of contacts to be handled to solve a TOI island.
b2Settings
  b2_maxTOIJointsPerIsland : int = 32
[static] Maximum number of joints to be handled to solve a TOI island.
b2Settings
  b2_pi : Number = 3.141592653589793
[static]
b2Settings
  b2_timeToSleep : Number = 0.5
[static] The time that a body must be still before it will go to sleep.
b2Settings
  b2_toiSlop : Number = 0.04
[static] Continuous collision detection (CCD) works with core, shrunken shapes.
b2Settings
  b2_velocityThreshold : Number = 1.0
[static] A velocity threshold for elastic collisions.
b2Settings
  USHRT_MAX : int = 0x0000ffff
[static]
b2Settings
  VERSION : String = "2.0.2"
[static] The current version of Box2D
b2Settings
Method detail
b2Assert()method
public static function 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
b2MixFriction()method 
public static function b2MixFriction(friction1:Number, friction2:Number):Number

Friction mixing law. Feel free to customize this.

Parameters
friction1:Number
 
friction2:Number

Returns
Number
b2MixRestitution()method 
public static function b2MixRestitution(restitution1:Number, restitution2:Number):Number

Restitution mixing law. Feel free to customize this.

Parameters
restitution1:Number
 
restitution2:Number

Returns
Number
Constant detail
b2_angularSleepToleranceconstant
public static const b2_angularSleepTolerance:Number = 0.011111111111111112

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

b2_angularSlopconstant 
public static const b2_angularSlop:Number

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

b2_contactBaumgarteconstant 
public static const b2_contactBaumgarte:Number = 0.2

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.

b2_linearSleepToleranceconstant 
public static const b2_linearSleepTolerance:Number = 0.01

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

b2_linearSlopconstant 
public static const b2_linearSlop:Number = 0.005

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

b2_maxAngularCorrectionconstant 
public static const b2_maxAngularCorrection:Number

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

b2_maxAngularVelocityconstant 
public static const b2_maxAngularVelocity:Number = 250.0

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.

b2_maxAngularVelocitySquaredconstant 
public static const b2_maxAngularVelocitySquared:Number = 62500.0
b2_maxLinearCorrectionconstant 
public static const b2_maxLinearCorrection:Number = 0.2

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

b2_maxLinearVelocityconstant 
public static const b2_maxLinearVelocity:Number = 200.0

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.

b2_maxLinearVelocitySquaredconstant 
public static const b2_maxLinearVelocitySquared:Number = 40000.0
b2_maxManifoldPointsconstant 
public static const b2_maxManifoldPoints:int = 2

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

b2_maxPolygonVerticesconstant 
public static const b2_maxPolygonVertices:int = 8

The maximun allowed vertices in a polygon. As polygons must be convex, there is usually little point increasing this.

b2_maxTOIContactsPerIslandconstant 
public static const b2_maxTOIContactsPerIsland:int = 32

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

b2_maxTOIJointsPerIslandconstant 
public static const b2_maxTOIJointsPerIsland:int = 32

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

b2_piconstant 
public static const b2_pi:Number = 3.141592653589793
b2_timeToSleepconstant 
public static const b2_timeToSleep:Number = 0.5

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

b2_toiSlopconstant 
public static const b2_toiSlop:Number = 0.04

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
b2_velocityThresholdconstant 
public static const b2_velocityThreshold:Number = 1.0

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

USHRT_MAXconstant 
public static const USHRT_MAX:int = 0x0000ffff
VERSIONconstant 
public static const VERSION:String = "2.0.2"

The current version of Box2D