Vector problem

I have a pool game and now am currently writing the AI player. I am starting with just the cue ball and one ball and trying to get the AI to pocket the ball. I have calculated all the vectors and found a generic formula for where the cue ball needs to strike the other ball for it to get in the pocket. The problem occurs when I multiply the vector and then apply that using the addForce() method. After multiplying the vector to give enough power to actually make the shot the cue ball now hits the other ball slightly off. If I use the original vector it hits the cue ball in the correct position but friction slows it down to much to use as the actual power.



My thoughts are either its floating point inaccuracy or the spin and mass involved in JME physics 2 is changing the cue balls direction very slightly. I have manually calculated the multiple of the vectors and it is correct so that made me think it wasn't a floating point vector.



Is there anyway to make sure the cue ball stays on the give path??



Thanks for any help.

Adding a singular high force might result in unwanted effects - try applying a lower force in multiple time steps.

Thats a good idea but wouldn't it make it not look like a real pool shot as it would go along get slower speed up get slower and so on.

Just some steps - the user should not notice it (e.g. 10ms).