Advertisement

A question about reflections, with a diagram!

Started by January 26, 2003 08:33 PM
4 comments, last by skjinedmjeet 22 years ago
Hi. I''d probably know the answer to this question if I was/had been/is doing physics in school. But I''m not! (Unfortunately. If I had been clever, I would''ve been, but it''s too late now, and besides: this has nothing to do with my question.) My question is this. I have "Billy the Crazy Bouncing Bean Bag" hurtling towards his death. He has (quite unfortunately for him) been shot by vector "B". He is heading towards the strictly two dimensional terrain. I know the vector along the segment terrain he is colliding with. This vector is vector "A". (See pretty blue shading.) What I need to do, is find vector "C", the vector that represents "Bill the Crazy Bouncing Been Bag"''s velocity after coliding with the terrain, assuming that none of his energy is lost in the collision, and also assuming that there is no such thing as friction. I kept finding tutorials/articles that didn''t really apply on google, and so...well... I thought... maybe... if I drew a picture, you wouldn''t dismiss me as some dolt that needs to take a physics class. (Even though I am just a dolt in need of a physics class...)
-=skjin=-
You can decompose crazy bob''s velocity into components perpendicular and parallel to the normal at the point of impact. The parallel component will be unaffected by the impact while the perpendicular component will be reversed. If n is the unit normal and v is the velocity then (v.n)*n is the component parallel. The component parallel and the component perpendicular sum to the velocity vector. So you subtract the component parallel twice to reverse it, i.e. 1-2=-1.
Keys to success: Ability, ambition and opportunity.
Advertisement
I'll just supplement LilBudyWizer's post by adding that if you want to have a more realistic bounce you can can reduce the magnitude of the reversed normal component to account for an imperfect collision, e.g., apply a coefficient of restitution less than 1. Also, you can add the effect of friction by reducing the tangential component of velocity. Thus, the object will slow down both tangentially and normally during the collision. A further thing you could to do add realism would be to apply a torque to the object for a couple of frames based on the friction force encountered while it is in contact with the terrain. These are a bit advanced, but its not too difficult to add quick-and-dirty approximations to them and the result can be quite nice for some games. A few links:

This one is a very good place to look to get a better understanding of what I'm trying to say:

carini.physics.indiana.edu/E105/spin-and-collisions.html

Some others:

Coefficient of restitution/imperfect collisions:

scienceworld.wolfram.com/physics/CoefficientofRestitution.html

Kinetic Friction:

scienceworld.wolfram.com/physics/KineticFriction.html

For a quick-and-dirty solution, you can just assume that the friction and coefficient of restitution effects do not interact in any way.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

[edited by - grhodes_at_work on January 27, 2003 12:02:33 PM]
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Me physics isn''t to strong, but say you apply friction. Is it just a fixed multiplier to the tangential component or does it depend upon the angle of collision? Well, the percentage change in velocity is dependant either way, but hopefully you know what I mean.
Keys to success: Ability, ambition and opportunity.
Friction is not meaningful when considering collisions (unless you''re thinking about rotation). Imperfect collisions are a good thing to implement, but easy to fake; just multiply the perpendicular vector by some number -1 < n < 0, instead of -1.


Don''t listen to me. I''ve had too much coffee.
quote:
Original post by LilBudyWizer
Me physics isn''t to strong, but say you apply friction. Is it just a fixed multiplier to the tangential component or does it depend upon the angle of collision? Well, the percentage change in velocity is dependant either way, but hopefully you know what I mean.


A fixed multiplier would be a very good fake friction effect for many games. You might even make the multiplier a linear function of the collision velocity. In reality, its more complex. For a rigid body the friction force could be modeled using a Coulomb friction model, which says the friction force that reduces the tangential velocity is equal to a friction coefficient times the normal direction reaction force applied between the colliding object and the wall. And that normal force is a function of collision angle. For a simulation, you''d assume the friction force acts for the entire time frame, and to determine the change in velocity you''d just apply that deceleration in the tangential direction using the usual Newton''s 2nd law of motion (F = ma integration).

In reality, objects are not purely rigid and the friction effect is quite complex. The flexing of the object, a function of the material and inertia properties, collision angle, collision angle, etc.. And the friction is a function of the flexed shape. The friction actually isn''t even constant over the contact area, and it also varies continuously over time so the idea of holding friction constant over a frame is not really reality. The object shape will actually vibrate for a period of time, and both the n ormal force and friction are varying in an oscillatory fashion throughout the collision. But for games, all this stuff is way overkill. For now. In ten years, who knows?
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement