Basically i am trying to apply impulse to a round body in a specific angle. But the body moves in a erratic direction. Can anyone please help me.
b2Vec2 v1 = bombbody->GetPosition();
b2Vec2 v2 = arrowPoint;//Value got from touch
b2Vec2 final = v2-v1;
float angle1 = CC_RADIANS_TO_DEGREES(atan2(final.y,final.x));
float factor = sqrt(final.x/PTM_RATIO * final.x/PTM_RATIO + final.y/PTM_RATIO * final.y/PTM_RATIO);
b2Vec2 ImpulseVector = b2Vec2(cos(angle1)*factor,sin(angle1)*factor);
b2Vec2 PointVector = bombbody->GetPosition();
bombbody->ApplyLinearImpulse(ImpulseVector,PointVector);