#include "user_constants.h"
Go to the source code of this file.
Data Structures | |
struct | b2Version |
Macros | |
#define | b2_lengthUnitsPerMeter 1.0f |
#define | b2_pi 3.14159265359f |
https://en.wikipedia.org/wiki/Pi | |
#define | b2_aabbMargin (0.1f * b2_lengthUnitsPerMeter) |
#define | b2_linearSlop (0.005f * b2_lengthUnitsPerMeter) |
#define | b2_angularSlop (2.0f / 180.0f * b2_pi) |
#define | b2_maxPolygonVertices 8 |
#define | b2_maxWorlds 32 |
Maximum number of simultaneous worlds that can be allocated. | |
#define | b2_maxTranslation (4.0f * b2_lengthUnitsPerMeter) |
#define | b2_maxRotation (0.5f * b2_pi) |
#define | b2_speculativeDistance (4.0f * b2_linearSlop) |
#define | b2_timeToSleep 0.5f |
The time that a body must be still before it will go to sleep. In seconds. | |
#define | b2_linearSleepTolerance (0.01f * b2_lengthUnitsPerMeter) |
A body cannot sleep if its linear velocity is above this tolerance. Meters per second. | |
#define | b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) |
A body cannot sleep if its angular velocity is above this tolerance. Radians per second. | |
#define | b2_huge (100000.0f * b2_lengthUnitsPerMeter) |
#define | b2_maxWorkers 64 |
Maximum parallel workers. Used to size some static arrays. | |
#define | b2_graphColorCount 12 |
Solver graph coloring. | |
Constants used by box2d. box2d uses meters-kilograms-seconds (MKS) units. Angles are always in radians unless degrees are indicated. Some values can be overridden by using a compiler definition. Other values cannot be modified without causing stability and/or performance problems. Although most of these are not user configurable, it can be interesting for a user to see these to understand the tuning values Box2D uses.
struct b2Version |
Version numbering scheme. See http://en.wikipedia.org/wiki/Software_versioning
Data Fields | ||
---|---|---|
int | major |
< significant changes incremental changes |
int | minor | bug fixes |
int | revision |
#define b2_aabbMargin (0.1f * b2_lengthUnitsPerMeter) |
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.
#define b2_angularSlop (2.0f / 180.0f * b2_pi) |
A small angle used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant.
#define b2_huge (100000.0f * b2_lengthUnitsPerMeter) |
Used to detect bad values. Positions greater than about 16km will have precision problems, so 100km as a limit should be fine in all cases.
#define b2_lengthUnitsPerMeter 1.0f |
box2d bases all length units on meters, but you may need different units for your game. You can override this value to use different units.
#define b2_linearSlop (0.005f * b2_lengthUnitsPerMeter) |
A small length used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant. In meters.
#define b2_maxPolygonVertices 8 |
The maximum number of vertices on a convex polygon. Changing this affects performance even if you don't use more vertices.
#define b2_maxRotation (0.5f * b2_pi) |
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.
#define b2_maxTranslation (4.0f * b2_lengthUnitsPerMeter) |
The maximum linear translation of a body per step. This limit is very large and is used to prevent numerical problems. You shouldn't need to adjust this. Meters.
#define b2_speculativeDistance (4.0f * b2_linearSlop) |