Quadraxas: That would work if the ball didn't move. Adding both velocities may also be a possibility, but you have to take care of their directions somehow (the behaviour is different when the ball is moving towards the player as when its moving away from the player). Still, maybe its accurate enough for the situation David is in (or: "Mr. Lancester is in." I don't want to come across as rude!)??

But maybe something like that could be used as said easier approach...

semi-pseudo-code

vec_set(tempb,s_p);
vec_sub(tempb,s_b);
vec_set(temp,v_s);
t = vec_length(tempb)/(vec_length(temp)+vec_dot(tempb,v_b));


This time, I didn't think that hard about it, so maybe, it has to be minus vec_dot, or something completely different altogether. Maybe I shouldn't have posted this before thinking more thoroughly about it?! \:\)

EDIT: It should also be mentioned that my approach further up can be adjusted for different movements (i.e. the player needs to accerlate first, or the ball may fly in a different curve.)

Last edited by Error014; 04/08/08 15:59. Reason: gave possible adjustments to the approach in my first post

Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!