#### Archived

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

# Collision physics

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

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

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633662
• Total Posts
3013230
×