Sign in to follow this  
EvilProject

rigid body collision response

Recommended Posts

Hi, Im trying to implement a particle system in which some of the particles follow rigid body dynamics. i'v been reading several articles regarding collision response of rigid body's in the past few days,but sadly most of articles assume some background in physics which i dont have. all i want is a code snip that will generate the proper response , given a the collision info. the collision check method provides me with the position in the rigid body's local space in which the collision occurred ,and the normal of the plane which the rigid body collided into. i want to calculate the new velocity and angular velocity of the body. thanks in advance.

Share this post


Link to post
Share on other sites
http://www.euclideanspace.com/physics/dynamics/collision/twod/index.htm

If you need the 3d version it's available in the navigation tree along the top. If i can find the resource i intended to show you, i'll post that later.

Basically the idea is, you find the point in time and space when an object is just touching another object, and the goal is to prevent penetration. You're going to do so by applying an impulse to the objects at the point of contact which will induce an angular and linear change in velocity, ideally zeroing the relative velocity between the objects at the contact point so they wont penetrate in the near future.

[Edited by - bzroom on August 13, 2009 11:38:26 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by bzroom
http://www.euclideanspace.com/physics/dynamics/collision/twod/index.htm

If you need the 3d version it's available in the navigation tree along the top. If i can find the resource i intended to show you, i'll post that later.


thanks for the response :),i went threw the article , i was looking just for something like this.
nevertheless i do have some questions.

1) are there any optimizations for the first method presented in the article? it seems quite heavy (as far i understand the other methods are in case i want to give up friction or rotation).

2) what if the rigid body collides with an object that is static , like walls floor or a ceiling , can i use the method presented in this article for that purpose two ?

3)one of the arguments the function requires is called N and described as such "normal to collision point, the line along which the impulse acts "
will that be the normal of the collision plane?

Share this post


Link to post
Share on other sites
1.) It's really not the heavy. They have just broken it down into the multiple components so it looks like a lot. A vector and matrix library will clean that right up and show you that it's just a few multiplications.

2.) With a static object you will refactor the equation to make it only respect the mass and inertia of a single object. Since the mass and interia of an immoveable object are infinite, there is some equation which is equal to the limit of those values going to infinity. I wish i could find the other resource i had in mind because it illustrates that formula. But you're correct, there are two.

3.) Yes, N is the contact plane normal.

Edit:
Here we go: http://www.myphysicslab.com/collision.html
Figure 11 is the impulse equation for two bodies, and just below it is the derivation for a collision with an immoveable object.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this