예제 #1
0
void
cpPolyShapeSetVerts(cpShape *shape, int numVerts, cpVect *verts, cpVect offset)
{
	assert(shape->klass == &polyClass);
	cpPolyShapeDestroy(shape);
	setUpVerts((cpPolyShape *)shape, numVerts, verts, offset);
}
예제 #2
0
파일: cpPolyShape.c 프로젝트: pes6pro/visva
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);
}
예제 #3
0
파일: cpPolyShape.c 프로젝트: pes6pro/visva
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;
}
예제 #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;
}