I have to do a school project, and i decided to use Chipmunk.
I did manage to do some things but, for the moment:
- I don't know how we represent density in chipmunk
- i have to do a sort of balance that I use as a catapult(composed a triangle(static object) and 3 lines(object) to project balls) . I want that my object to be on the top of the triangle. Do i have to do like that:
Code: Select all
static cpBody* make_support(cpFloat x, cpFloat y){
int num=4;
cpVect* test=transforme_ligne(-170,0,100,0,10);
cpVect* test2=transforme_ligne(-170,0,-170,60,3);
cpVect* test3=transforme_ligne(100,0,130,60,3);
cpBody* body=cpBodyNew(10.0,cpMomentForPoly(0.2,num,test,cpvzero));
body->p=cpv(x,y);
cpSpaceAddBody(space,body);
shape=cpPolyShapeNew(body,num,test,cpvzero);
shape->e=0.8;shape->u=0.8;
cpSpaceAddShape(space,shape);
shape=cpPolyShapeNew(body,num,test2,cpvzero);
shape->e=0.8;shape->u=0.8;
cpSpaceAddShape(space,shape);
shape=cpPolyShapeNew(body,num,test3,cpvzero);
cpSpaceAddShape(space,shape);
return body;
}
Thx for your help.
Dark