Chipmunk2D Pro API Reference  7.0.2
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Functions
cpPolyShape

Functions

CP_EXPORT cpPolyShapecpPolyShapeAlloc (void)
 Allocate a polygon shape.
 
CP_EXPORT cpPolyShapecpPolyShapeInit (cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius)
 Initialize a polygon shape with rounded corners. More...
 
CP_EXPORT cpPolyShapecpPolyShapeInitRaw (cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpFloat radius)
 Initialize a polygon shape with rounded corners. More...
 
CP_EXPORT cpShapecpPolyShapeNew (cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius)
 Allocate and initialize a polygon shape with rounded corners. More...
 
CP_EXPORT cpShapecpPolyShapeNewRaw (cpBody *body, int count, const cpVect *verts, cpFloat radius)
 Allocate and initialize a polygon shape with rounded corners. More...
 
CP_EXPORT cpPolyShapecpBoxShapeInit (cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height, cpFloat radius)
 Initialize a box shaped polygon shape with rounded corners.
 
CP_EXPORT cpPolyShapecpBoxShapeInit2 (cpPolyShape *poly, cpBody *body, cpBB box, cpFloat radius)
 Initialize an offset box shaped polygon shape with rounded corners.
 
CP_EXPORT cpShapecpBoxShapeNew (cpBody *body, cpFloat width, cpFloat height, cpFloat radius)
 Allocate and initialize a box shaped polygon shape.
 
CP_EXPORT cpShapecpBoxShapeNew2 (cpBody *body, cpBB box, cpFloat radius)
 Allocate and initialize an offset box shaped polygon shape.
 
CP_EXPORT int cpPolyShapeGetCount (const cpShape *shape)
 Get the number of verts in a polygon shape.
 
CP_EXPORT cpVect cpPolyShapeGetVert (const cpShape *shape, int index)
 Get the ith vertex of a polygon shape.
 
CP_EXPORT cpFloat cpPolyShapeGetRadius (const cpShape *shape)
 Get the radius of a polygon shape.
 

Detailed Description

Function Documentation

CP_EXPORT cpPolyShape* cpPolyShapeInit ( cpPolyShape poly,
cpBody body,
int  count,
const cpVect verts,
cpTransform  transform,
cpFloat  radius 
)

Initialize a polygon shape with rounded corners.

A convex hull will be created from the vertexes.

CP_EXPORT cpPolyShape* cpPolyShapeInitRaw ( cpPolyShape poly,
cpBody body,
int  count,
const cpVect verts,
cpFloat  radius 
)

Initialize a polygon shape with rounded corners.

The vertexes must be convex with a counter-clockwise winding.

CP_EXPORT cpShape* cpPolyShapeNew ( cpBody body,
int  count,
const cpVect verts,
cpTransform  transform,
cpFloat  radius 
)

Allocate and initialize a polygon shape with rounded corners.

A convex hull will be created from the vertexes.

CP_EXPORT cpShape* cpPolyShapeNewRaw ( cpBody body,
int  count,
const cpVect verts,
cpFloat  radius 
)

Allocate and initialize a polygon shape with rounded corners.

The vertexes must be convex with a counter-clockwise winding.