# Physical Collision Response

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

## Recommended Posts

Hello, I have a collision detection of 2 spheres. Now i want to add physical collision response to that object.
Quote:
 The total momentum of the system before the collision is equal to the total momentum in the system after the collision.
Momentum = velocity * mass i can know the velocity before collision if i am using Euler Integration:
velocity += acceleration * deltaT;
position += velocity * deltaT;


if i am using Verlet Integration:
position += (position - prev_position) + acceleration * dt * dt;


Where there is no Velocity how can i use The Law of Momentum? Or is there any other way of doing it? And how to find Angular Velocity after Collision (Rotational Integration is Euler (not Verlet) )? Thanks, Kasya

##### Share on other sites
Even when you use velocity-less Verlet integration to update the position, you can compute an approximate velocity using position and prev_position, and dt, e.g.:

velocity = (position - prev_position) / dt;

(Make sure you compute this before you integrate *or* after integration but make sure you update both position and prev_position before computing the velocity.)

That is a two step backward difference to estimate velocity. It is equivalent to explicit Euler integration of position. If you are using the impulse momentum formulas to ensure momentum is conserved during the collision, this will enable you to do that. The velocities will be approximate, as they must be when you integrate numerically, but you can compute a momentum-conserving collision response based on the approximated velocities of the two objects. I hope that makes sense!

Using the impulse-momentum method, which I think is what you might be trying to do with the 2 spheres (since it derives nicely from the law of conservation of momentum for collisions between two spheres without accounting for friction or rotation), is good and easy for two spheres. But it becomes more difficult when: 1) you want to account for surface friction, which can introduction rotation; 2) you want to handle shapes that are not spherical, which can introduction rotations even without friction; 3) you want to handle concave shapes, which can generate multiple simultaneous contact points between two objects and with different relative surface velocities at each contact point leading to...you guessed it, rotations; and, 4) you want to handle the possibility of more than 2 objects colliding simultaneously.

There is a closed-form solution for the impulse-momentum formulation with rotation....for frictionless collisions between two objects. But it is significantly more complex than just the linear impulse-momentum. (See Dave Eberly's book Game Physics, or my own chapter "Real-time Game Physics" in the book Introduction to Game Development by Charles River Media for a derivation and discussion of why impulse momentum isn't necessarily the best approach for general physics sims). Dealing with collisions in the general case becomes messy. The closed-form impulse-momentum equations aren't always (and perhaps only rarely) used in full-featured physics engines. Penalty force methods are easier to implement, though they introduce problems of their own. Often there are various approaches to fix numerical error to give stable, realistic results. Momentum isn't necessarily conserved very well, but for games this isn't too important as long as the method converges and is stable. I would recommend looking at Erin Catto's "box2d" physics engine, which has a nice study on collision response for more general cases, in 2D. It's a great learning tool.

Hope that helps!

##### Share on other sites
Thanks for help! Can you please tell me what property is for what in contact:

- restitution coefficient
- depth of penetration
- direction of contact
- point of contact
- contact velocity
- desired change in velocity

The Point of contact:

- Is that at which point these Rigid Bodies are in contact?
- If there is more than one contact point, I need to create new contact, like one point for one contact?

And Please tell me what are the others for.

Thanks,
Kasya

##### Share on other sites
I don't really have time to give a tutorial here, but I can point you to some very good introductory reference material, which you can use for self-study. Please go to the sticky thread list of physics engines and reference material, at the top of the thread list for this forum and visit the "Essential Math" presentation materials link. The presentations at that link are a very good introduction to game physics, and include a very good introduction to collisions. It probably won't answer all your questions, but its a better introduction than I can possible give here. Here is the link to the sticky thread (but you can also see it at the top of the forum's thread list):

List of Physics Engines and Reference Material

Again, look for "Essential Math"

Hope that helps!

1. 1
2. 2
Rutin
26
3. 3
4. 4
5. 5

• 9
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632941
• Total Posts
3009330
• ### Who's Online (See full list)

There are no registered users currently online

×