I am trying to throw an arrow or spear to the sky. At the same time, I would expect it to spin or rotate naturally.
This is how I create the arrow in the following way..
Code: Select all
mass = 700;
elasticity = 0.9;
friction = 5.0;
collisionType = 1;
initialBodyPosition = cpv(60, 100.0);
layers = 1;
r = cpv(0,0);
body = cpBodyNew(mass, INFINITY);
body->p = initialBodyPosition;
cpVect verts_line[] = {
cpv(-2,-40),
cpv(-2, 40),
cpv( 2, 40),
cpv( 2,-40),
};
shape = cpPolyShapeNew(body, 4, verts_line, cpv(0, 35)); //cpCircleShapeNew(body, 20.0, cpvzero);
shape -> layers = layers;
//something like this.....
cpBodyApplyForce(k, cpv(7000,11000), cpv(500,30));
OR
cpBodyApplyImpulse(k, cpv(70000,110000), cpv(5000,300));
So the arrow does move, but it won't rotate or spin at all.
Does anyone know what I should do?
Or any example?
Thanks :>