Data Structures |
| struct | cpSpace |
| | Basic Unit of Simulation in Chipmunk. More...
|
Defines |
| #define | CP_DefineSpaceStructGetter(type, member, name) static inline type cpSpaceGet##name(const cpSpace *space){return space->member;} |
| #define | CP_DefineSpaceStructSetter(type, member, name) static inline void cpSpaceSet##name(cpSpace *space, type value){space->member = value;} |
| #define | CP_DefineSpaceStructProperty(type, member, name) |
Typedefs |
typedef struct
cpContactBufferHeader | cpContactBufferHeader |
| typedef void(* | cpSpaceArbiterApplyImpulseFunc )(cpArbiter *arb) |
| typedef void(* | cpPostStepFunc )(cpSpace *space, void *obj, void *data) |
| | Post Step callback function type.
|
| typedef void(* | cpSpacePointQueryFunc )(cpShape *shape, void *data) |
| | Point query callback function type.
|
| typedef void(* | cpSpaceSegmentQueryFunc )(cpShape *shape, cpFloat t, cpVect n, void *data) |
| | Segment query callback function type.
|
| typedef void(* | cpSpaceBBQueryFunc )(cpShape *shape, void *data) |
| | Rectangle Query callback function type.
|
| typedef void(* | cpSpaceShapeQueryFunc )(cpShape *shape, cpContactPointSet *points, void *data) |
| | Shape query callback function type.
|
| typedef void(* | cpSpaceBodyIteratorFunc )(cpBody *body, void *data) |
| | Space/body iterator callback function type.
|
| typedef void(* | cpSpaceShapeIteratorFunc )(cpShape *shape, void *data) |
| | Space/body iterator callback function type.
|
| typedef void(* | cpSpaceConstraintIteratorFunc )(cpConstraint *constraint, void *data) |
| | Space/constraint iterator callback function type.
|
Functions |
| cpSpace * | cpSpaceAlloc (void) |
| | Allocate a cpSpace.
|
| cpSpace * | cpSpaceInit (cpSpace *space) |
| | Initialize a cpSpace.
|
| cpSpace * | cpSpaceNew (void) |
| | Allocate and initialize a cpSpace.
|
| void | cpSpaceDestroy (cpSpace *space) |
| | Destroy a cpSpace.
|
| void | cpSpaceFree (cpSpace *space) |
| | Destroy and free a cpSpace.
|
| | CP_DefineSpaceStructProperty (int, iterations, Iterations) |
| | CP_DefineSpaceStructProperty (cpVect, gravity, Gravity) |
| | CP_DefineSpaceStructProperty (cpFloat, damping, Damping) |
| | CP_DefineSpaceStructProperty (cpFloat, idleSpeedThreshold, IdleSpeedThreshold) |
| | CP_DefineSpaceStructProperty (cpFloat, sleepTimeThreshold, SleepTimeThreshold) |
| | CP_DefineSpaceStructProperty (cpFloat, collisionSlop, CollisionSlop) |
| | CP_DefineSpaceStructProperty (cpFloat, collisionBias, CollisionBias) |
| | CP_DefineSpaceStructProperty (cpTimestamp, collisionPersistence, CollisionPersistence) |
| | CP_DefineSpaceStructProperty (cpBool, enableContactGraph, EnableContactGraph) |
| | CP_DefineSpaceStructProperty (cpDataPointer, data, UserData) |
| | CP_DefineSpaceStructGetter (cpBody *, staticBody, StaticBody) |
| | CP_DefineSpaceStructGetter (cpFloat, CP_PRIVATE(curr_dt), CurrentTimeStep) |
| static cpBool | cpSpaceIsLocked (cpSpace *space) |
| | returns true from inside a callback and objects cannot be added/removed.
|
| void | cpSpaceSetDefaultCollisionHandler (cpSpace *space, cpCollisionBeginFunc begin, cpCollisionPreSolveFunc preSolve, cpCollisionPostSolveFunc postSolve, cpCollisionSeparateFunc separate, void *data) |
| void | cpSpaceAddCollisionHandler (cpSpace *space, cpCollisionType a, cpCollisionType b, cpCollisionBeginFunc begin, cpCollisionPreSolveFunc preSolve, cpCollisionPostSolveFunc postSolve, cpCollisionSeparateFunc separate, void *data) |
| void | cpSpaceRemoveCollisionHandler (cpSpace *space, cpCollisionType a, cpCollisionType b) |
| | Unset a collision handler.
|
| cpShape * | cpSpaceAddShape (cpSpace *space, cpShape *shape) |
| cpShape * | cpSpaceAddStaticShape (cpSpace *space, cpShape *shape) |
| | Explicity add a shape as a static shape to the simulation.
|
| cpBody * | cpSpaceAddBody (cpSpace *space, cpBody *body) |
| | Add a rigid body to the simulation.
|
| cpConstraint * | cpSpaceAddConstraint (cpSpace *space, cpConstraint *constraint) |
| | Add a constraint to the simulation.
|
| void | cpSpaceRemoveShape (cpSpace *space, cpShape *shape) |
| | Remove a collision shape from the simulation.
|
| void | cpSpaceRemoveStaticShape (cpSpace *space, cpShape *shape) |
| | Remove a collision shape added using cpSpaceAddStaticShape() from the simulation.
|
| void | cpSpaceRemoveBody (cpSpace *space, cpBody *body) |
| | Remove a rigid body from the simulation.
|
| void | cpSpaceRemoveConstraint (cpSpace *space, cpConstraint *constraint) |
| | Remove a constraint from the simulation.
|
| cpBool | cpSpaceContainsShape (cpSpace *space, cpShape *shape) |
| | Test if a collision shape has been added to the space.
|
| cpBool | cpSpaceContainsBody (cpSpace *space, cpBody *body) |
| | Test if a rigid body has been added to the space.
|
| cpBool | cpSpaceContainsConstraint (cpSpace *space, cpConstraint *constraint) |
| | Test if a constraint has been added to the space.
|
| void | cpSpaceAddPostStepCallback (cpSpace *space, cpPostStepFunc func, void *obj, void *data) |
| void | cpSpacePointQuery (cpSpace *space, cpVect point, cpLayers layers, cpGroup group, cpSpacePointQueryFunc func, void *data) |
| | Query the space at a point and call func for each shape found.
|
| cpShape * | cpSpacePointQueryFirst (cpSpace *space, cpVect point, cpLayers layers, cpGroup group) |
| | Query the space at a point and return the first shape found. Returns NULL if no shapes were found.
|
| void | cpSpaceSegmentQuery (cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSpaceSegmentQueryFunc func, void *data) |
| | Perform a directed line segment query (like a raycast) against the space calling func for each shape intersected.
|
| cpShape * | cpSpaceSegmentQueryFirst (cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSegmentQueryInfo *out) |
| | Perform a directed line segment query (like a raycast) against the space and return the first shape hit. Returns NULL if no shapes were hit.
|
| void | cpSpaceBBQuery (cpSpace *space, cpBB bb, cpLayers layers, cpGroup group, cpSpaceBBQueryFunc func, void *data) |
| cpBool | cpSpaceShapeQuery (cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data) |
| | Query a space for any shapes overlapping the given shape and call func for each shape found.
|
| void | cpSpaceActivateShapesTouchingShape (cpSpace *space, cpShape *shape) |
| | Call cpBodyActivate() for any shape that is overlaps the given shape.
|
| void | cpSpaceEachBody (cpSpace *space, cpSpaceBodyIteratorFunc func, void *data) |
| | Call func for each body in the space.
|
| void | cpSpaceEachShape (cpSpace *space, cpSpaceShapeIteratorFunc func, void *data) |
| | Call func for each shape in the space.
|
| void | cpSpaceEachConstraint (cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data) |
| | Call func for each shape in the space.
|
| void | cpSpaceReindexStatic (cpSpace *space) |
| | Update the collision detection info for the static shapes in the space.
|
| void | cpSpaceReindexShape (cpSpace *space, cpShape *shape) |
| | Update the collision detection data for a specific shape in the space.
|
| void | cpSpaceReindexShapesForBody (cpSpace *space, cpBody *body) |
| | Update the collision detection data for all shapes attached to a body.
|
| void | cpSpaceUseSpatialHash (cpSpace *space, cpFloat dim, int count) |
| | Switch the space to use a spatial has as it's spatial index.
|
| void | cpSpaceStep (cpSpace *space, cpFloat dt) |
| | Step the space forward in time by dt.
|