Exemple #1
0
void
cpPolyShapeSetVerts(cpShape *shape, int numVerts, cpVect *verts, cpVect offset)
{
	assert(shape->klass == &polyClass);
	cpPolyShapeDestroy(shape);
	setUpVerts((cpPolyShape *)shape, numVerts, verts, offset);
}
Exemple #2
0
void
cpPolyShapeSetVerts(cpShape *shape, int numVerts, cpVect *verts, cpVect offset)
{
    cpAssertHard(shape->klass == &polyClass, "Shape is not a poly shape.");
    cpPolyShapeDestroy((cpPolyShape *)shape);
    setUpVerts((cpPolyShape *)shape, numVerts, verts, offset);
}
Exemple #3
0
cpPolyShape *
cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int numVerts, const cpVect *verts, cpVect offset)
{
    setUpVerts(poly, numVerts, verts, offset);
    cpShapeInit((cpShape *)poly, &polyClass, body);

    return poly;
}
cpPolyShape *
cpPolyShapeInit2(cpPolyShape *poly, cpBody *body, int numVerts, const cpVect *verts, cpVect offset, cpFloat radius)
{
	setUpVerts(poly, numVerts, verts, offset);
	cpShapeInit((cpShape *)poly, &polyClass, body);
	poly->r = radius;

	return poly;
}
Exemple #5
0
cpPolyShape *
cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int numVerts, cpVect *verts, cpVect offset)
{
	// Fail if the user attempts to pass a concave poly, or a bad winding.
	assert(cpPolyValidate(verts, numVerts));
	
	setUpVerts(poly, numVerts, verts, offset);
	cpShapeInit((cpShape *)poly, &polyClass, body);

	return poly;
}