Chipmunk  6.0.3
Chipmunk API Reference for Kobold2D developers
cpShape.h File Reference
This graph shows which files directly or indirectly include this file:

Data Structures

struct  cpSegmentQueryInfo
 Segment query info struct. More...
struct  cpShapeClass
struct  cpShape
 Opaque collision shape struct. More...
struct  cpCircleShape
struct  cpSegmentShape

Defines

#define CP_DefineShapeStructGetter(type, member, name)   static inline type cpShapeGet##name(const cpShape *shape){return shape->member;}
#define CP_DefineShapeStructSetter(type, member, name, activates)
#define CP_DefineShapeStructProperty(type, member, name, activates)
#define CP_DeclareShapeGetter(struct, type, name)   type struct##Get##name(const cpShape *shape)

Typedefs

typedef cpBB(* cpShapeCacheDataImpl )(cpShape *shape, cpVect p, cpVect rot)
typedef void(* cpShapeDestroyImpl )(cpShape *shape)
typedef cpBool(* cpShapePointQueryImpl )(cpShape *shape, cpVect p)
typedef void(* cpShapeSegmentQueryImpl )(cpShape *shape, cpVect a, cpVect b, cpSegmentQueryInfo *info)

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.
 CP_DefineShapeStructGetter (cpBody *, body, Body)
void cpShapeSetBody (cpShape *shape, cpBody *body)
 CP_DefineShapeStructGetter (cpBB, bb, BB)
 CP_DefineShapeStructProperty (cpBool, sensor, Sensor, cpTrue)
 CP_DefineShapeStructProperty (cpFloat, e, Elasticity, cpFalse)
 CP_DefineShapeStructProperty (cpFloat, u, Friction, cpTrue)
 CP_DefineShapeStructProperty (cpVect, surface_v, SurfaceVelocity, cpTrue)
 CP_DefineShapeStructProperty (cpDataPointer, data, UserData, cpFalse)
 CP_DefineShapeStructProperty (cpCollisionType, collision_type, CollisionType, cpTrue)
 CP_DefineShapeStructProperty (cpGroup, group, Group, cpTrue)
 CP_DefineShapeStructProperty (cpLayers, layers, Layers, cpTrue)
void cpResetShapeIdCounter (void)
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.
cpCircleShapecpCircleShapeAlloc (void)
 Allocate a circle shape.
cpCircleShapecpCircleShapeInit (cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset)
 Initialize a circle shape.
cpShapecpCircleShapeNew (cpBody *body, cpFloat radius, cpVect offset)
 Allocate and initialize a circle shape.
 CP_DeclareShapeGetter (cpCircleShape, cpVect, Offset)
 CP_DeclareShapeGetter (cpCircleShape, cpFloat, Radius)
cpSegmentShapecpSegmentShapeAlloc (void)
 Allocate a segment shape.
cpSegmentShapecpSegmentShapeInit (cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat radius)
 Initialize a segment shape.
cpShapecpSegmentShapeNew (cpBody *body, cpVect a, cpVect b, cpFloat radius)
 Allocate and initialize a segment shape.
void cpSegmentShapeSetNeighbors (cpShape *shape, cpVect prev, cpVect next)
 CP_DeclareShapeGetter (cpSegmentShape, cpVect, A)
 CP_DeclareShapeGetter (cpSegmentShape, cpVect, B)
 CP_DeclareShapeGetter (cpSegmentShape, cpVect, Normal)
 CP_DeclareShapeGetter (cpSegmentShape, cpFloat, Radius)

Function Documentation

CP_DeclareShapeGetter ( cpCircleShape  ,
cpVect  ,
Offset   
)
CP_DeclareShapeGetter ( cpCircleShape  ,
cpFloat  ,
Radius   
)
CP_DeclareShapeGetter ( cpSegmentShape  ,
cpVect  ,
 
)
CP_DeclareShapeGetter ( cpSegmentShape  ,
cpVect  ,
 
)
CP_DeclareShapeGetter ( cpSegmentShape  ,
cpVect  ,
Normal   
)
CP_DeclareShapeGetter ( cpSegmentShape  ,
cpFloat  ,
Radius   
)
cpCircleShape* cpCircleShapeAlloc ( void  )

Allocate a circle shape.

cpCircleShape* cpCircleShapeInit ( cpCircleShape circle,
cpBody body,
cpFloat  radius,
cpVect  offset 
)

Initialize a circle shape.

cpShape* cpCircleShapeNew ( cpBody body,
cpFloat  radius,
cpVect  offset 
)

Allocate and initialize a circle shape.

cpSegmentShape* cpSegmentShapeAlloc ( void  )

Allocate a segment shape.

cpSegmentShape* cpSegmentShapeInit ( cpSegmentShape seg,
cpBody body,
cpVect  a,
cpVect  b,
cpFloat  radius 
)

Initialize a segment shape.

cpShape* cpSegmentShapeNew ( cpBody body,
cpVect  a,
cpVect  b,
cpFloat  radius 
)

Allocate and initialize a segment shape.

void cpSegmentShapeSetNeighbors ( cpShape shape,
cpVect  prev,
cpVect  next 
)