Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


How to determine velocity after a collision?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 dabo   Members   -  Reputation: 148

Like
0Likes
Like

Posted 22 April 2012 - 01:03 PM

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.

Sponsor:

#2 jefferytitan   Crossbones+   -  Reputation: 2242

Like
0Likes
Like

Posted 22 April 2012 - 05:01 PM

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 ™. 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.

#3 dabo   Members   -  Reputation: 148

Like
0Likes
Like

Posted 23 April 2012 - 10:36 AM

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:

Posted Image

, where

Posted Image is the scalar velocity of the object after impact
Posted Image is the scalar velocity of the object before impact


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].


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? Posted Image

#4 dabo   Members   -  Reputation: 148

Like
0Likes
Like

Posted 27 April 2012 - 02:43 AM

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;


#5 jefferytitan   Crossbones+   -  Reputation: 2242

Like
0Likes
Like

Posted 28 April 2012 - 05:16 AM

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?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS