How to determine velocity after a collision?

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

Recommended Posts

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.

Share on other sites
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.

Share on other sites
I did some more googling and managed to find something called Coefficient of restitution: [url="http://en.wikipedia.org/wiki/Coefficient_of_restitution"]http://en.wikipedia...._of_restitution[/url], perhaps this is what you were referring to? It says:

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

, where

[img]http://upload.wikimedia.org/wikipedia/en/math/9/e/3/9e3669d19b675bd57058fd4664205d2a.png[/img] is the scalar velocity of the object after impact
[/quote]

Some more googling led me to this document [url="http://www.dissertations.wsu.edu/Thesis/Spring2008/R_Anderson_042308.pdf"]http://www.dissertat...rson_042308.pdf[/url], it says:

[quote]
[size=3]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]. [/size]
[/quote]

[size=4]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:[/size]

[size=4]v = 0.267 * u?[/size]

[size=4]In code I get the following:[/size]

[size=4][CODE]/* 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;
[/CODE][/size]

[size=4]The result looks pretty good, does this look correct to any of you guys? [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img][/size]

Share on other sites
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:
[CODE]
velocity.Y = 0.267 * velocity.Y;
[/CODE]

Share on other sites
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?

Share on other sites

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

Create an account

Register a new account

• Forum Statistics

• Total Topics
628710
• Total Posts
2984334

• 23
• 11
• 10
• 13
• 14