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

Functions

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

Detailed Description

Function Documentation

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.

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.

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.

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.