Classes | Macros | Functions | Variables
b2_common.h File Reference
#include "b2_settings.h"
#include <stddef.h>
#include <assert.h>
#include <float.h>
Include dependency graph for b2_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  b2Version
 

Macros

#define b2_aabbExtension   (0.1f * b2_lengthUnitsPerMeter)
 
#define b2_aabbMultiplier   4.0f
 
#define b2_angularSleepTolerance   (2.0f / 180.0f * b2_pi)
 A body cannot sleep if its angular velocity is above this tolerance. More...
 
#define b2_angularSlop   (2.0f / 180.0f * b2_pi)
 
#define b2_baumgarte   0.2f
 
#define b2_epsilon   FLT_EPSILON
 
#define b2_linearSleepTolerance   (0.01f * b2_lengthUnitsPerMeter)
 A body cannot sleep if its linear velocity is above this tolerance. More...
 
#define b2_linearSlop   (0.005f * b2_lengthUnitsPerMeter)
 
#define b2_maxAngularCorrection   (8.0f / 180.0f * b2_pi)
 
#define b2_maxFloat   FLT_MAX
 
#define b2_maxLinearCorrection   (0.2f * b2_lengthUnitsPerMeter)
 
#define b2_maxManifoldPoints   2
 
#define b2_maxRotation   (0.5f * b2_pi)
 
#define b2_maxRotationSquared   (b2_maxRotation * b2_maxRotation)
 
#define b2_maxSubSteps   8
 Maximum number of sub-steps per contact in continuous physics simulation. More...
 
#define b2_maxTOIContacts   32
 Maximum number of contacts to be handled to solve a TOI impact. More...
 
#define b2_maxTranslation   (2.0f * b2_lengthUnitsPerMeter)
 
#define b2_maxTranslationSquared   (b2_maxTranslation * b2_maxTranslation)
 
#define B2_NOT_USED(x)   ((void)(x))
 
#define b2_pi   3.14159265359f
 
#define b2_polygonRadius   (2.0f * b2_linearSlop)
 
#define b2_timeToSleep   0.5f
 The time that a body must be still before it will go to sleep. More...
 
#define b2_toiBaumgarte   0.75f
 
#define b2Assert(A)   assert(A)
 
#define b2DEBUG
 

Functions

void b2CloseDump ()
 
void b2Dump (const char *string,...)
 
void b2OpenDump (const char *fileName)
 Dump to a file. Only one dump file allowed at a time. More...
 

Variables

B2_API b2Version b2_version
 Current version. More...
 

Detailed Description

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

Definition in file b2_common.h.

Macro Definition Documentation

◆ b2_aabbExtension

#define b2_aabbExtension   (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.

Definition at line 56 of file b2_common.h.

◆ b2_aabbMultiplier

#define b2_aabbMultiplier   4.0f

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.

Definition at line 61 of file b2_common.h.

◆ b2_angularSleepTolerance

#define b2_angularSleepTolerance   (2.0f / 180.0f * b2_pi)

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

Definition at line 119 of file b2_common.h.

◆ b2_angularSlop

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

Definition at line 69 of file b2_common.h.

◆ b2_baumgarte

#define b2_baumgarte   0.2f

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.

Definition at line 106 of file b2_common.h.

◆ b2_epsilon

#define b2_epsilon   FLT_EPSILON

Definition at line 40 of file b2_common.h.

◆ b2_linearSleepTolerance

#define b2_linearSleepTolerance   (0.01f * b2_lengthUnitsPerMeter)

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

Definition at line 116 of file b2_common.h.

◆ b2_linearSlop

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

Definition at line 65 of file b2_common.h.

◆ b2_maxAngularCorrection

#define b2_maxAngularCorrection   (8.0f / 180.0f * b2_pi)

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

Definition at line 91 of file b2_common.h.

◆ b2_maxFloat

#define b2_maxFloat   FLT_MAX

Definition at line 39 of file b2_common.h.

◆ b2_maxLinearCorrection

#define b2_maxLinearCorrection   (0.2f * b2_lengthUnitsPerMeter)

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

Definition at line 87 of file b2_common.h.

◆ b2_maxManifoldPoints

#define b2_maxManifoldPoints   2

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

Definition at line 51 of file b2_common.h.

◆ b2_maxRotation

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

Definition at line 100 of file b2_common.h.

◆ b2_maxRotationSquared

#define b2_maxRotationSquared   (b2_maxRotation * b2_maxRotation)

Definition at line 101 of file b2_common.h.

◆ b2_maxSubSteps

#define b2_maxSubSteps   8

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

Definition at line 77 of file b2_common.h.

◆ b2_maxTOIContacts

#define b2_maxTOIContacts   32

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

Definition at line 83 of file b2_common.h.

◆ b2_maxTranslation

#define b2_maxTranslation   (2.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.

Definition at line 95 of file b2_common.h.

◆ b2_maxTranslationSquared

#define b2_maxTranslationSquared   (b2_maxTranslation * b2_maxTranslation)

Definition at line 96 of file b2_common.h.

◆ B2_NOT_USED

#define B2_NOT_USED (   x)    ((void)(x))

Definition at line 36 of file b2_common.h.

◆ b2_pi

#define b2_pi   3.14159265359f

Definition at line 41 of file b2_common.h.

◆ b2_polygonRadius

#define b2_polygonRadius   (2.0f * b2_linearSlop)

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.

Definition at line 74 of file b2_common.h.

◆ b2_timeToSleep

#define b2_timeToSleep   0.5f

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

Definition at line 113 of file b2_common.h.

◆ b2_toiBaumgarte

#define b2_toiBaumgarte   0.75f

Definition at line 107 of file b2_common.h.

◆ b2Assert

#define b2Assert (   A)    assert(A)

Definition at line 37 of file b2_common.h.

◆ b2DEBUG

#define b2DEBUG

Definition at line 33 of file b2_common.h.

Function Documentation

◆ b2CloseDump()

void b2CloseDump ( )

Definition at line 70 of file b2_settings.cpp.

◆ b2Dump()

void b2Dump ( const char *  string,
  ... 
)

Definition at line 57 of file b2_settings.cpp.

◆ b2OpenDump()

void b2OpenDump ( const char *  fileName)

Dump to a file. Only one dump file allowed at a time.

Definition at line 51 of file b2_settings.cpp.

Variable Documentation

◆ b2_version

B2_API b2Version b2_version

Current version.

Definition at line 30 of file b2_settings.cpp.



mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22