LiquidFun
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Typedefs | Functions | Variables
b2Settings.h File Reference
#include <stddef.h>
#include <assert.h>
#include <float.h>

Go to the source code of this file.

Classes

struct  b2Version
 

Macros

#define B2_NOT_USED(x)   ((void)(x))
 
#define b2Assert(A)
 
#define B2_ASSERT_ENABLED   0
 
#define B2_DEBUG_STATEMENT(A)
 
#define B2_ARRAY_SIZE(x)   (sizeof(x) / sizeof((x)[0]))
 
#define b2_maxFloat   FLT_MAX
 
#define b2_epsilon   FLT_EPSILON
 
#define b2_pi   3.14159265359f
 
#define b2Inline   inline
 
#define LIQUIDFUN_EXTERNAL_LANGUAGE_API   0
 
#define b2_maxManifoldPoints   2
 
#define b2_maxPolygonVertices   8
 
#define b2_aabbExtension   0.1f
 
#define b2_aabbMultiplier   2.0f
 
#define b2_linearSlop   0.005f
 
#define b2_angularSlop   (2.0f / 180.0f * b2_pi)
 
#define b2_polygonRadius   (2.0f * b2_linearSlop)
 
#define b2_maxSubSteps   8
 Maximum number of sub-steps per contact in continuous physics simulation.
 
#define b2_maxTOIContacts   32
 Maximum number of contacts to be handled to solve a TOI impact.
 
#define b2_velocityThreshold   1.0f
 
#define b2_maxLinearCorrection   0.2f
 
#define b2_maxAngularCorrection   (8.0f / 180.0f * b2_pi)
 
#define b2_maxTranslation   2.0f
 
#define b2_maxTranslationSquared   (b2_maxTranslation * b2_maxTranslation)
 
#define b2_maxRotation   (0.5f * b2_pi)
 
#define b2_maxRotationSquared   (b2_maxRotation * b2_maxRotation)
 
#define b2_baumgarte   0.2f
 
#define b2_toiBaugarte   0.75f
 
#define b2_invalidParticleIndex   (-1)
 NEON SIMD requires 16-bit particle indices. More...
 
#define b2_maxParticleIndex   0x7FFFFFFF
 
#define b2_particleStride   0.75f
 The default distance between particles, multiplied by the particle diameter.
 
#define b2_minParticleWeight   1.0f
 The minimum particle weight that produces pressure.
 
#define b2_maxParticlePressure   0.25f
 The upper limit for particle pressure.
 
#define b2_maxParticleForce   0.5f
 The upper limit for force between particles.
 
#define b2_maxTriadDistance   2
 
#define b2_maxTriadDistanceSquared   (b2_maxTriadDistance * b2_maxTriadDistance)
 
#define b2_minParticleSystemBufferCapacity   256
 The initial size of particle data buffers.
 
#define b2_barrierCollisionTime   2.5f
 The time into the future that collisions against barrier particles will be detected.
 
#define b2_timeToSleep   0.5f
 The time that a body must be still before it will go to sleep.
 
#define b2_linearSleepTolerance   0.01f
 A body cannot sleep if its linear velocity is above this tolerance.
 
#define b2_angularSleepTolerance   (2.0f / 180.0f * b2_pi)
 A body cannot sleep if its angular velocity is above this tolerance.
 

Typedefs

typedef signed char int8
 
typedef signed short int16
 
typedef signed int int32
 
typedef unsigned char uint8
 
typedef unsigned short uint16
 
typedef unsigned int uint32
 
typedef float float32
 
typedef double float64
 
typedef long long int64
 
typedef unsigned long long uint64
 
typedef void *(* b2AllocFunction )(int32 size, void *callbackData)
 Use this function to override b2Alloc() without recompiling this library.
 
typedef void(* b2FreeFunction )(void *mem, void *callbackData)
 Use this function to override b2Free() without recompiling this library.
 

Functions

void * b2Alloc (int32 size)
 Implement this function to use your own memory allocator.
 
void b2Free (void *mem)
 If you implement b2Alloc, you should also implement this function.
 
void b2SetAllocFreeCallbacks (b2AllocFunction allocCallback, b2FreeFunction freeCallback, void *callbackData)
 
void b2SetNumAllocs (const int32 numAllocs)
 
int32 b2GetNumAllocs ()
 Get number of calls to b2Alloc minus number of calls to b2Free.
 
void b2Log (const char *string,...)
 Logging function.
 

Variables

b2Version b2_version
 
const b2Version b2_liquidFunVersion
 Global variable is used to identify the version of LiquidFun.
 
const char * b2_liquidFunVersionString
 

Detailed Description

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

Macro Definition Documentation

#define b2_aabbExtension   0.1f

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_aabbMultiplier   2.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.

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

#define b2_invalidParticleIndex   (-1)

NEON SIMD requires 16-bit particle indices.

A symbolic constant that stands for particle allocation error.

#define b2_linearSlop   0.005f

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

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

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

#define b2_maxLinearCorrection   0.2f

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

#define b2_maxManifoldPoints   2

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

#define b2_maxPolygonVertices   8

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

#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   2.0f

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.

#define b2_maxTriadDistance   2

The maximum distance between particles in a triad, multiplied by the particle diameter.

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

#define b2_velocityThreshold   1.0f

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

Function Documentation

void b2SetAllocFreeCallbacks ( b2AllocFunction  allocCallback,
b2FreeFunction  freeCallback,
void *  callbackData 
)

Set alloc and free callbacks to override the default behavior of using malloc() and free() for dynamic memory allocation. Set allocCallback and freeCallback to NULL to restore the default allocator (malloc / free).

void b2SetNumAllocs ( const int32  numAllocs)

Set the number of calls to b2Alloc minus the number of calls to b2Free. This can be used to disable the empty heap check in b2SetAllocFreeCallbacks() which can be useful for testing.

Variable Documentation

const char* b2_liquidFunVersionString

String which identifies the current version of LiquidFun. b2_liquidFunVersionString is used by Google developers to identify which applications uploaded to Google Play are using this library. This allows the development team at Google to determine the popularity of the library. How it works: Applications that are uploaded to the Google Play Store are scanned for this version string. We track which applications are using it to measure popularity. You are free to remove it (of course) but we would appreciate if you left it in.

b2Version b2_version

Current version. Version of Box2D, LiquidFun is based upon.