Help predetermined collision detection

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

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 on other sites
Does any one know how to tell were an object is going before it gets there?

Share on other sites
Quote:
 Original post by kingpinzsDoes 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

where:
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.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
5. 5

• 9
• 12
• 16
• 26
• 10
• Forum Statistics

• Total Topics
633769
• Total Posts
3013759
×