in reply to Some simple 2d game-related maths questions

Are you sure dx, dy aren't so big that the ball teleports right past the line? It may be that all the ball needs to do is quantum tunnel far enough that the center of the ball is on the other side of the line? Maybe you could post a little code showing your calculation and indicate the range dx, dy are likely to take?


Perl reduces RSI - it saves typing
  • Comment on Re: Some simple 2d game-related maths questions

Replies are listed 'Best First'.
Re^2: Some simple 2d game-related maths questions
by Anonymous Monk on Aug 28, 2008 at 15:33 UTC
    To prevent such cases, I have generally taken the *previous* position value when deciding. "They're touching now, and it came from thataway."

      So in fact you need to perform a complicated area intersection with the area traced out by the moving object and the boundary line unless you can guarantee that the object won't move twice it's "diameter" or more in a single update.


      Perl reduces RSI - it saves typing