Jump to content
  • Advertisement
Sign in to follow this  

Help predetermined collision detection

This topic is 4171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I looked over the fourm faq and did not see this in it. What kind of equation would I use to predetermined collision between 2 objects? I know it has to do whith the objects velocity, current position and direction so my ball_velocity = speed / time; speed += 4; time = GetTickCount() - start; ball_velocity, current_position and ball_direction needs to be put in some sort of algorithm to give solution to will the ball collide with the wall or score a point before it even does it. Also I belive I need to figure out how long it will take to get to werfe its going before it gets there. Not sure how to do that either. with all the above I think the real question is. will Paddle.x intersect ball.x before ball.y is to high or to low. To high would be 0 and to low would be 600. Thanks [Edited by - kingpinzs on April 22, 2007 4:03:29 PM]

Share this post

Link to post
Share on other sites
Original post by kingpinzs
Does any one know how to tell were an object is going before it gets there?

Well, you can use the standard equations of motion for a body at time t:

pf = 0.5*(F/m)*dt^2 + vi*dt + pi

pf = final position
pi = initial position
m = mass of body
t = time interval
F = average force over the time interval

alternatively you can replace F with a function of t and have variable acceleration if that's what you want.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!