How to determine velocity after a collision?

Started by
3 comments, last by jefferytitan 11 years, 11 months ago
Hi,

I am working on a simple hockey game and I have come to the stage where I need to handle collisions between the puck and the ice, boards, posts etc. What I need help with is how do I determine the velocity after a collision? The velocity is a vector and I have a method for reflecting it which means the puck will bounce. However right now when a puck is shot high in the air and eventually drops down onto the ice again it will bounce and reach approximately the same height on each bounce (if I ignore air resistance). As anyone who watches hockey knows the puck hardly bounces at all (for simplicity I will assume the puck always lands flat) when it hits the ice. How do I calculate this loss of velocity? Do I need to calculate energy loss or something? Any help would be appreciated, not sure what to google for. If I need to provide more information let me know.
Advertisement
I can't recall the technical terms, but I believe your issue is about physics materials. Your puck seems to be acting like a rubber ball with 100% elasticity. I gather that a puck would have a very low elasticity, e.g. 5%. This means that every collision 95% of the motion in the direction of the collision normal would be transferred to the object that it collides with. In the case of collision with the ground, you can assume that energy is just lost because The Earth Is Very Heavy (TM). The other 5% would turn into bounce. For practicality you may choose to zero out the vertical component if it's under a small amount.
I did some more googling and managed to find something called Coefficient of restitution: http://en.wikipedia...._of_restitution, perhaps this is what you were referring to? It says:


For an object bouncing off a stationary object, such as a floor:

c0b72b848dd7fbf58ab4e2568a9ea053.png

, where

9e3669d19b675bd57058fd4664205d2a.png is the scalar velocity of the object after impact
7b774effe4a349c6dd82ad4f4f21d34c.png is the scalar velocity of the object before impact
[/quote]

Some more googling led me to this document http://www.dissertat...rson_042308.pdf, it says:


Vertical drop tests to determine the puck’s coefficient of restitution (COR) have been performed and found COR values in the range of .45-.55 at room temperature and .12-.27 for frozen pucks [1].
[/quote]

The average found at 25° F (~ -3.9° C) was apparently 0.267 so I will try to use this number. Is it as simple as to just calculate:

v = 0.267 * u?

In code I get the following:

/* Collision with ice. */
/* iceNormal and velocity are of type Vector3. */

/* Normalize the normal of the ice i.e. (0,1,0) */
iceNormal.Normalize();

/* Reflect the velocity vector so that the puck bounces up again. */
velocity.Reflect(iceNormal);

/* Calculate velocity after collision, v = Cr * u */
velocity = 0.267 * velocity;


The result looks pretty good, does this look correct to any of you guys? smile.png

I have looked around a bit more and I've seen examples of implementations where only the vertical component of the velocity vector is affected by the coefficient of restitution; the horizontal component is only affected by friction. Is this correct? If so my code above is incorrect and it would explain why my puck slows down so much horizontally when it bounces. But I am not sure the angle of the bounce is correct if only the vertical component is affected by COR. Could anyone clarify this please?

The last line above would be this instead:

velocity.Y = 0.267 * velocity.Y;
I imagine that Cr would be affected by shape and thickness, so it bounces much less vertically than horizontally because it's thin and flat in that direction. Make sense?

This topic is closed to new replies.

Advertisement