27 #define B2_NOT_USED(x) ((void)(x))
28 #if DEBUG && !defined(NDEBUG)
29 #define b2Assert(A) assert(A)
30 #define B2_ASSERT_ENABLED 1
33 #define B2_ASSERT_ENABLED 0
38 #define B2_DEBUG_STATEMENT(A) A
40 #define B2_DEBUG_STATEMENT(A)
44 #define B2_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
46 typedef signed char int8;
47 typedef signed short int16;
48 typedef signed int int32;
49 typedef unsigned char uint8;
50 typedef unsigned short uint16;
51 typedef unsigned int uint32;
52 typedef float float32;
53 typedef double float64;
56 typedef __int64 int64;
57 typedef unsigned __int64 uint64;
59 typedef long long int64;
60 typedef unsigned long long uint64;
63 #define b2_maxFloat FLT_MAX
64 #define b2_epsilon FLT_EPSILON
65 #define b2_pi 3.14159265359f
67 #if !defined(b2Inline)
69 #define b2Inline __attribute__((always_inline))
71 #define b2Inline inline
72 #endif // defined(__GNUC__)
73 #endif // !defined(b2Inline)
77 #if !defined(LIQUIDFUN_EXTERNAL_LANGUAGE_API)
78 #if SWIG || LIQUIDFUN_UNIT_TESTS
79 #define LIQUIDFUN_EXTERNAL_LANGUAGE_API 1
81 #define LIQUIDFUN_EXTERNAL_LANGUAGE_API 0
93 #define b2_maxManifoldPoints 2
97 #define b2_maxPolygonVertices 8
102 #define b2_aabbExtension 0.1f
107 #define b2_aabbMultiplier 2.0f
111 #define b2_linearSlop 0.005f
115 #define b2_angularSlop (2.0f / 180.0f * b2_pi)
120 #define b2_polygonRadius (2.0f * b2_linearSlop)
123 #define b2_maxSubSteps 8
129 #define b2_maxTOIContacts 32
133 #define b2_velocityThreshold 1.0f
137 #define b2_maxLinearCorrection 0.2f
141 #define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi)
145 #define b2_maxTranslation 2.0f
146 #define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation)
150 #define b2_maxRotation (0.5f * b2_pi)
151 #define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation)
156 #define b2_baumgarte 0.2f
157 #define b2_toiBaugarte 0.75f
163 #if !defined(B2_USE_16_BIT_PARTICLE_INDICES) && defined(LIQUIDFUN_SIMD_NEON)
164 #define B2_USE_16_BIT_PARTICLE_INDICES
168 #define b2_invalidParticleIndex (-1)
170 #ifdef B2_USE_16_BIT_PARTICLE_INDICES
171 #define b2_maxParticleIndex 0x7FFF
173 #define b2_maxParticleIndex 0x7FFFFFFF
177 #define b2_particleStride 0.75f
180 #define b2_minParticleWeight 1.0f
183 #define b2_maxParticlePressure 0.25f
186 #define b2_maxParticleForce 0.5f
190 #define b2_maxTriadDistance 2
191 #define b2_maxTriadDistanceSquared (b2_maxTriadDistance * b2_maxTriadDistance)
194 #define b2_minParticleSystemBufferCapacity 256
197 #define b2_barrierCollisionTime 2.5f
202 #define b2_timeToSleep 0.5f
205 #define b2_linearSleepTolerance 0.01f
208 #define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi)
219 typedef void* (*b2AllocFunction)(int32 size,
void* callbackData);
240 void b2Log(
const char*
string, ...);
void b2Log(const char *string,...)
Logging function.
Definition: b2Settings.cpp:116
void(* b2FreeFunction)(void *mem, void *callbackData)
Use this function to override b2Free() without recompiling this library.
Definition: b2Settings.h:221
int32 minor
incremental changes
Definition: b2Settings.h:247
void b2Free(void *mem)
If you implement b2Alloc, you should also implement this function.
Definition: b2Settings.cpp:99
void * b2Alloc(int32 size)
Implement this function to use your own memory allocator.
Definition: b2Settings.cpp:93
void *(* b2AllocFunction)(int32 size, void *callbackData)
Use this function to override b2Alloc() without recompiling this library.
Definition: b2Settings.h:219
b2Version b2_version
Definition: b2Settings.cpp:25
Definition: b2Settings.h:244
const char * b2_liquidFunVersionString
Definition: b2Settings.cpp:41
int32 major
significant changes
Definition: b2Settings.h:246
int32 b2GetNumAllocs()
Get number of calls to b2Alloc minus number of calls to b2Free.
Definition: b2Settings.cpp:110
const b2Version b2_liquidFunVersion
Global variable is used to identify the version of LiquidFun.
Definition: b2Settings.cpp:36
void b2SetNumAllocs(const int32 numAllocs)
Definition: b2Settings.cpp:105
void b2SetAllocFreeCallbacks(b2AllocFunction allocCallback, b2FreeFunction freeCallback, void *callbackData)
Definition: b2Settings.cpp:72
int32 revision
bug fixes
Definition: b2Settings.h:248