The cpShape struct defines the shape of a rigid body. More...
Classes | |
struct | cpSegmentQueryInfo |
Segment query info struct. More... | |
struct | cpShapeClass |
struct | cpShape |
Opaque collision shape struct. More... | |
Typedefs | |
typedef struct cpSegmentQueryInfo | cpSegmentQueryInfo |
Segment query info struct. | |
Functions | |
void | cpShapeDestroy (cpShape *shape) |
Destroy a shape. | |
void | cpShapeFree (cpShape *shape) |
Destroy and Free a shape. | |
cpBB | cpShapeCacheBB (cpShape *shape) |
Update, cache and return the bounding box of a shape based on the body it's attached to. | |
cpBB | cpShapeUpdate (cpShape *shape, cpVect pos, cpVect rot) |
Update, cache and return the bounding box of a shape with an explicit transformation. | |
cpBool | cpShapePointQuery (cpShape *shape, cpVect p) |
Test if a point lies within a shape. | |
void | cpResetShapeIdCounter (void) |
When initializing a shape, it's hash value comes from a counter. | |
cpBool | cpShapeSegmentQuery (cpShape *shape, cpVect a, cpVect b, cpSegmentQueryInfo *info) |
Perform a segment query against a shape. info must be a pointer to a valid cpSegmentQueryInfo structure. | |
static cpVect | cpSegmentQueryHitPoint (const cpVect start, const cpVect end, const cpSegmentQueryInfo info) |
Get the hit point for a segment query. | |
static cpFloat | cpSegmentQueryHitDist (const cpVect start, const cpVect end, const cpSegmentQueryInfo info) |
Get the hit distance for a segment query. |
The cpShape struct defines the shape of a rigid body.
void cpResetShapeIdCounter | ( | void | ) |
When initializing a shape, it's hash value comes from a counter.
Because the hash value may affect iteration order, you can reset the shape ID counter when recreating a space. This will make the simulation be deterministic.