Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl: the Markov chain saw
 
PerlMonks  

Re: Some simple 2d game-related maths questions

by GrandFather (Cardinal)
on Aug 27, 2008 at 23:00 UTC ( #707337=note: print w/ replies, xml ) Need Help??


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
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://707337]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-04-17 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (444 votes), past polls