Collision and Contacts with friction

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

Recommended Posts

Hi I have studied rigid body simulation from "Physically Based Modeling: Principles and Practice" by David Baraff and "Physics for Game Developers",but i have some questions. Suppose,i have a sphere with angular velocity x,at height y and it's subject only by gravity.When simulation start it falling in down,when it collide with ground(ground plane have friction) : 1)angular momentum with normal reaction of ground plane is null 2)angular momentum with tangetial friction force is not null At this time,in reality,the mass center sphere should acquire velocity due friction force in x direction. do you have paper or book where i can study this ? i know which is the relation between angular and linear velocity,but i don't understand how can integrate it in my engine. My engine is based on impulse force. thx

Share on other sites
I have no papers or books to show, but maybe I can help explain what is happening in words. Perhaps you already know what what is going on, but maybe it can begin some discussion on solving the problem.

In reality, when the object hits the ground, the object will deform(perhaps be crushed it force exceeds the compressive strength), touch the ground for some period of time(perhaps bounce), and gain velocity in the direction it was spinning. Unfortunately, simulating exactly this is very difficult.

What you could do is; determine what the x velocity difference between the landing point at the falling object is. If the falling object is spinning quickly, the co-efficient of dynamic friction must be used, otherwise use the co-efficient of static friction.

Using f = uN, you can now calculate the force on the object in the x direction using the mass of the object. The apply this force for the length of the time the object is touching the ground before it bounces.

If the object is not going to bounce, you can subtract the momentum gained in the x direction, from the current angular momentum, until there is no more angular momentum.

Share on other sites
compute the impulse to exactly change the tangential velocity to zero and compare it with the dynamic friction force and the static friction force and select the proper one to use.

Share on other sites
I would take a look at Erin Catto's presentation on modeling and solving constraints, available here:

Essential Math for Games Programmers Tutorials

Erin's presentation is quite nice, and discusses incorporating friction into contact resolution, for impulse-based engines.

The other presentations in that series are also nice references, though outside the scope of your question.

Share on other sites
I've done a little of bit of kinetic friction here (last chapter) on impulse dynamics. I don't know how accurate it is though, but it looks good.

Share on other sites
now it's work,but i have another problem.
ball never stops,i dont understand what happen when

relative velocity = 0
angular velocity = tangent linear velocity * radius
impulse =0

in this case the ball go in rolling without slice,so angular velocity = tangent linear velocity * radius

I think something handle is missing in my engine.

to understand more i upload this video

Share on other sites
The ball does not stop because you don't have rolling friction. Current engines use simple linear and angular damping to work around this. Erin Catto presented a method based on constraints that kind of model rolling friction. Search the Bullet forum if you are interested in this approach. Finally the paper by Eran Guendelman "Non-convex rigid bodies with stacking" gives a short explanation of rolling friction.

Personally I think you should get away with linear and angular damping. I am not aware of any commercial engine that models rolling friction. Maybe the Ageia Wheel-Constraint, but I haven't looked into it for a while.

-Dirk

Share on other sites
hi, i have studied a little and i think i have found a good solution to simulate rolling friction.

i try to implement a system of contact force

if RelativeVelocity along normal of impact is less than a certain tolerance and RelativeAcceleration is accelerating torward in ground plane,then the body is in cotact and apply contact force: normal reaction of plane and friction with plane.

relativeVelcoity = body->vVelocity+(body->vAngularVelocity^vCollisionPoint);
RelativeAccelleration = (body->vForces/body->fMass)+((body->vMoments/body->fInertia) ^ vCollisionPoint);

where "^" is vector product and "*" is scalar product.

At this point in the solver for contact :

vContactForce = (body->fMass * (-data->vRelativeAcceleration *
data->vCollisionNormal)) *
data->vCollisionNormal;
vContactFriction = (vContactForce.Magn() *
static friction coefficient) *
data->vCollisionTangent;

body->vForces += vContactForce;
body->vMoments +=data->vCollisionPoint^vContactForce;

body->vForces += vContactFriction;
body->vMoments +=data->vCollisionPoint^vContactFriction;

where data->vCollisionTangent = -(vRelativeVelocity-((vRelativeVelocity*NormalCollisionPlane)*NormalCollisionPlane));

In this way when collision tanget is zero,because RelativeVelocity is round zero,no more friction force will be added.

Now my problem is : at some point my CollisionTangent sweeps between -1,0,0 and 1,0,0 in this way relative velocity never goes to zero and the ball never stops.

do you have any suggestions?

i think it's a numerical problem and you what about ?

Share on other sites
this is what happens,when:

Linear Velocity = 1.187353 0.043137 0.000000 and Angular Velocity = 0.000000 0.000000 -2.031620 => Relative Velocity = -0.844267 0.043137 0.000000 => Tangent = -1 0 0 this is ok

after integration

Linear Velocity = 1.561913 0.043137 0.000000 and Angular Velocity = 0.000000 0.000000 -1.095220 => Relative Velocity = 0.466692 0.043137 0.000000 => Tangent = 1 0 0

where

Relative Velocity = Linear Velocity + (Angular Velocity^ Collision Point)
Tanget = ((Relative Velocity*n)*n) - Relative Velocity.

where is the problem :( ?

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 14
• 10
• 9
• 11
• Forum Statistics

• Total Topics
634096
• Total Posts
3015493
×