I need to know how to use box2d for projectile motion.
initially, projectileTime=0; then i call the following function for projectile motion. It works pretty good. But i want to achieve the same thing using box2d. As far as i know Box2d works only with force, it does not encourage placing object directly, So how to use Box2d for projectile movement??
-(void)projectilelaunched:(ccTime)dt
{
projectileTime+=(5*dt);
double vh=v*cos(theta);
x=vh*projectileTime;
double y = x*tan(theta)- 10*((x/vh)*(x/vh))/2;
projectile.position=ccp(projectilePositionBeforeLaunched.x + x,projectilePositionBeforeLaunched.y+y);
}