finding force to launch a ball to go thru a position[solved]

sundar
Posts: 2
Joined: Fri Jul 16, 2010 10:33 am

finding force to launch a ball to go thru a position[solved]

Post by sundar »

Hi,

I am new to bullet physics library. i am wondering is there any way to find the initial force to launch a rigidbody so that it passes thru a point.

Thanks for the help
Last edited by sundar on Fri Jul 16, 2010 12:12 pm, edited 1 time in total.
sundar
Posts: 2
Joined: Fri Jul 16, 2010 10:33 am

Re: finding initial force to launch a ball to go thru a posi

Post by sundar »

sundar wrote:Hi,

I am new to bullet physics library. i am wondering is there any way to find the initial force to launch a rigidbody so that it passes thru a point.

Thanks for the help

Actually never mind. i have figured this out.

basically the targetvector - initialvector gives the target direction. so once we get the target direction we need to normalise & multiply it with constant solved my problem.

here is my code (using irrlicht vectors)

Code: Select all

    irr::core::vector3df forwardDir(( targetPosition - initialPosition).normalize() * 400);
    body->setLinearVelocity(forwardDir);

Thanks