22 #ifndef CHIPMUNK_HEADER
23 #define CHIPMUNK_HEADER
32 #ifndef CP_ALLOW_PRIVATE_ACCESS
33 #define CP_ALLOW_PRIVATE_ACCESS 0
36 #if CP_ALLOW_PRIVATE_ACCESS == 1
37 #define CP_PRIVATE(symbol) symbol
39 #define CP_PRIVATE(symbol) symbol##_private
42 void cpMessage(
const char *condition,
const char *file,
int line,
int isError,
int isHardError,
const char *message, ...);
44 #define cpAssertWarn(condition, ...)
46 #define cpAssertWarn(condition, ...) if(!(condition)) cpMessage(#condition, __FILE__, __LINE__, 0, 0, __VA_ARGS__)
50 #define cpAssertSoft(condition, ...)
52 #define cpAssertSoft(condition, ...) if(!(condition)) cpMessage(#condition, __FILE__, __LINE__, 1, 0, __VA_ARGS__)
56 #define cpAssertHard(condition, ...) if(!(condition)) cpMessage(#condition, __FILE__, __LINE__, 1, 1, __VA_ARGS__)
59 #include "chipmunk_types.h"
65 #ifndef CP_BUFFER_BYTES
66 #define CP_BUFFER_BYTES (32*1024)
71 #define cpcalloc calloc
76 #define cprealloc realloc
84 typedef struct cpArray cpArray;
85 typedef struct cpHashSet cpHashSet;
91 typedef struct cpCollisionHandler cpCollisionHandler;
98 #include "cpSpatialIndex.h"
102 #include "cpPolyShape.h"
104 #include "cpArbiter.h"
105 #include "constraints/cpConstraint.h"
110 #define CP_VERSION_MAJOR 6
111 #define CP_VERSION_MINOR 1
112 #define CP_VERSION_RELEASE 4
172 #define CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__) \
173 cpVect *__verts_var__ = (cpVect *)alloca(__count__*sizeof(cpVect)); \
174 int __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0); \
176 #if defined(__has_extension)
177 #if __has_extension(blocks)
182 void cpSpaceEachBody_b(
cpSpace *space,
void (^block)(
cpBody *body));
183 void cpSpaceEachShape_b(
cpSpace *space,
void (^block)(
cpShape *shape));
186 void cpBodyEachShape_b(
cpBody *body,
void (^block)(
cpShape *shape));
188 void cpBodyEachArbiter_b(
cpBody *body,
void (^block)(
cpArbiter *arbiter));
196 typedef void (^cpSpaceBBQueryBlock)(
cpShape *shape);