Archived

This topic is now archived and is closed to further replies.

hello2k1

Collision physics

Recommended Posts

Well I''ve finally finished the basics of my collision detection, and now I''d like to add "bouncing" or "collision physics" (not sure what the proper name is) to my engine. For example, if I threw a tennis ball at a wall, what sort of forces would be exerted on the tennis ball and the wall? (not taking gravity and such into account) ------------------------------ There are 10 types of people in this world, those who know binary, and those who don''t.

Share this post


Link to post
Share on other sites
Without all the friction and elasticity and so on, probably the simplest behaviour is that the ball "reflects" off the wall at an angle equal to its approach. So if the ball's initial velocity is v, and the normal to the wall is n, the ball's velocity after collision would be v' = v - n * DotProduct(n, v) * 2.

I think that would give you Pong-style physics, where things bounce "perfectly".

[edited by - khirsah on August 10, 2003 5:41:06 PM]

Share this post


Link to post
Share on other sites
if that a full-on rigid body physics, or moving-sphere collision detection with no phsyics, to which you want to add physics?

for the latter, I use a simple algo for my particle dynamics

Vnorm = (V * N) * N
Vfric = (1 - CoF) * (V - Vnorm)
Vrest = -(1 + CoR) * Vnorm
Vresult = Vfric + Vrest;

V is your incoming velocity vector
N is the normal of the collisoin plane
Vnorm is the impact velocity, along the normal of collision.

Vfric is the resulting velocity along the collision plane after applying friction.
Vrest is the resulting velocity along the collision normal.

Vresult is the resulting velocity after impact.

CoR is the coefficient of restitution (or ''bounce'').
CoF is a coefficient of frition (sort of).

CoF and CoR are in the range [0, 1].


for the former, it''s a lot more complicated. you need the velocity at the point of impact, the inertia, the masses of the two objects, the point of impact, the normal of impact, angular components.... See this

http://www.cs.unc.edu/~ehmann/RigidTutorial/

half way through, it''s got a pretty beefy collision impulse equation the give you the force (more like the impulse) after an impact between two rigid bodies.

Share this post


Link to post
Share on other sites
Sorry oliii, but you''re link doesnt seem to be working. Do you or anyone else here have any good links for this sort of thing? (would be best if it included how to find the "bounce" of an object and such)

Thanks again.

------------------------------
There are 10 types of people in this world, those who know binary, and those who don''t.

Share this post


Link to post
Share on other sites