Have started with a rectangle using the demo code but i am a bit lost on how to make a pivot type motion.
Demo 7 has a pivot joint example but it looks more like a rope than a paddle.
Demo 8 has apply force example to make the paddle move "body->velocity_func = apply_force;"
It is basically a "door opening" type movement i want to create. Any ideas?
this is what i have so far
Code: Select all
int num = 4;
cpVect verts[] = {
cpv(-15,-15),
cpv(-15, 15),
cpv( 35, 15),
cpv( 35,-15),
};
body = cpBodyNew(1.0, cpMomentForPoly(1.0, num, verts, cpvzero));
body->p = cpv(-280, 240);
body->velocity_func = apply_force;
cpSpaceAddBody(space, body);
shape = cpPolyShapeNew(body, num, verts, cpvzero);
shape->e = 0.0; shape->u = 1.5;
shape->collision_type = 1;
cpSpaceAddShape(space, shape);