Advertisement

collision

Started by July 12, 2002 01:58 PM
5 comments, last by hali 22 years, 7 months ago
i''ve got 2 spheres, which lie in XZ plane, one of them isnt moveing and the other one is moveing with some linear velocity (both of them dont have angular velocities), finally theres a collision between them, and there isnt gravity because of the collision theres an angular momentum which affects the sphere, and its equal to cross product of the "bouncing" force and the "arm", "bouncing" force is working along the normal vector put out from the point which collides, and the "arm" is a vector between center of the sphere and the point which collides, in this case, the "bouncing" force vector and the "arm" vector are linear dependent so cross product from them is equal to vector [0,0,0], so spheres wont move after the collision, but i think that the one which was motionless should surely rotate round the Y axis so no i really dont know, am i calculating something wrong?
There are actually two forces (or force components) involved. The first force, your "bouncing" force, which is applied at the collision point normal to the surfaces of the sphere, will cause a change in motion of both spheres but only translational motion---no rotation. This is good, old-fashioned and simple pool-table physics (see article below). As you observed, this particular force does not cause rotation. But there can also be a frictional force, which acts along the surface tangent at the collision point, That frictional force is perpendicular to the the "arm" vector and therefore will cause rotation if the friction force is nonzero.

Without the friction, you will not cause a sphere to rotate that was not already rotating to begin with.

For a great discussion of pool-table physics, see this article:

www.gamasutra.com/features/20020118/vandenhuevel_01.htm

The article doesn''t talk about rotational effects, but you can gain some useful info.

(registration on gamasutra is free.)

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Advertisement

ok, thx for the answer , but now i''ve got only problem with rotation, ive already done collison detection & other stuff

how should i count the value & direction of that frictional force?
u said that this force acts along the surface tangent at the collision point, but there are many vectors which does that, so which of them should i choose?
quote:
Original post by hali
how should i count the value & direction of that frictional force?
u said that this force acts along the surface tangent at the collision point, but there are many vectors which does that, so which of them should i choose?



The real-world sitatuation is actually a bit tricky for two reasons. First, if the spheres are not rotating when they hit, the friction will act along different tangent vectors over time as the two spheres slide past one another. If either sphere is rotating/spinning when they hit, the specific tangent vector is a function of the spin direction.

Lets keep this simple for now. Assume that the two spheres stay in contact only for a short period of time (nearly instantaneous). In this case you can choose friction to be applied to a specific tangent. Here's how to find the correct tangent vector:

1) Find the vector that points from the center of ball A to the center of ball B, and call that vector AB. Make it a unit vector.

2) Find the difference of the two ball velocities, vel_A and vel_B using this formula: vel_diff = vel_A - vel_B. Go ahead and make it a unit vector.

3) If vel_diff is parallel to AB then there is no friction (the balls are colliding head-on)

4) If vel_diff and AB are not parallel, then there is a friction force and it is applied along the tangent to the two balls in the plane that contains both vel_diff and AB. The tangent can be found in this way:

tangent_vec = Normalize(vel_diff - AB*DotProduct(AB, vel_diff));

Basically, that formula just exploits the fact that AB is normal to both spheres, and subtracts away the component of vel_diff that is normal, leaving just the portion of vel_diff that is tangent to the spheres.

Keep in mind that the friction force will act along tangent_vec on one sphere, and along -tangent_vec on the other sphere.

This solution isn't quite correct if either sphere is spinning when they collide. But it is a start, and should help you to produce spin.

Hope that helps!

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

[edited by - grhodes_at_work on July 15, 2002 2:34:07 PM]
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
quote:
Original post by hali
how should i count the value & direction of that frictional force?


You already have an answer for the direction of the frictional force. The magnitude of the friction force is equal to the friction coefficient between the two spheres times the magnitude of the normal force (your "bounding" force).



Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

well, i''ve thought about nearly the same, but i was takeing vector that points from the center of a ball A to the collision point instead of vector that points from the center of a ball A to a ball B, but ive got still some questions:

1) in all cases when u write "center of the ball" u mean "center of the mass of that body"?

2) is there any difference between rotating and spinning?

3) how should i do the collision when spheres are rotating? firstly ive changed relative velocity calculation to: vel_diff = vel_A - vel_B + CrossProduct(angular_velocity_A, collision_point - center_A) - CrossProduct(angular_velocity_B, collision_point - center_B), i think i should change sth more, cause i.e. when ive got sphere rolling on the ground its angular velocity is increasing during decreasing its linear velocity due to frictions, what should i change to handle that properly?
Advertisement
quote:
Original post by hali
1) in all cases when u write "center of the ball" u mean "center of the mass of that body"?



I do not mean "center of mass." The line of action of friction forces during collision have nothing to do with mass distribution---only geometry and kinematics. In the case of spheres, I really meant literally, "geometric center of the sphere." But lets expand that for arbitrary shapes.. For arbitrary shapes, the vector AB should point from the center-of-curvature at the collision point of object A to the center-of-curvature at the collision point of object B. In the case of spheres, the center-of-curvature of either corresponds to its center, and so the generalized approach simplifies to the sphere approach I presented earlier.

quote:
Original post by hali
2) is there any difference between rotating and spinning?



This is a bit of a tricky question. In my post, I mean to use the word "spinning" or "spin" everywhere. In general, there is a difference between rotating and spinning. Rotating can just mean translation along a curve that surrounds an axis without the body orientation changing at all, while spinning implies that the orientation of the body is changing. Friction causes spinning, not rotating.

quote:
Original post by hali
3) how should i do the collision when spheres are rotating? firstly ive changed relative velocity calculation to: vel_diff = vel_A - vel_B + CrossProduct(angular_velocity_A, collision_point - center_A) - CrossProduct(angular_velocity_B, collision_point - center_B), i think i should change sth more, cause i.e. when ive got sphere rolling on the ground its angular velocity is increasing during decreasing its linear velocity due to frictions, what should i change to handle that properly?


I don''t have a quick answer to that one for you. I''ll think about it for a while, but unfortunately I may not be able to get back with an answer since I''m simultaneously working towards a software release on August 7 and preparing to leave for SIGGRAPH this Saturday. For starters, why don''t you handle collisions in a way that ignores the current angular momentum/spinning of the objects. You can certainly update the angular momentum/spinning due to friction, just don''t use the spin in calculating the friction force.


Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement