Jump to content
  • Advertisement
Sign in to follow this  
captainfreedom

ball bounce calculation without using angles

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I found a nice vector tutorial that explains how to calculate ball bounce collisions using vectors. The maths are a lot easier because they use vectors rather than angles to do the calculation. Unfortunately, the last page (http://tonypa.pri.ee/vectors/tut11.html) he hasn't explained the rebound vector calculation properly. Does anyone know the theory behind this? "vc is vector between center points of balls, vcn is normal of vc. Now we project both movement vectors v1 and v2 onto vc and vcn: v1 is broken into components v1a and v1b, same way v2 breaks into v2a and v2b. For resulting movement vectors v1a and v2a are exchanged and ball1 will get new movement vector made from v1b and v2a while ball2 will get new movement from v1a and v2b. "

Share this post


Link to post
Share on other sites
Advertisement
SOunds like he is trying to explain the conservation of momentum. Check out Chris Hecker's docs for a better explaination.

in short

va' = va + (j / ma) * n
vb' = vb - (j / mb) * n
(va' - vb') . n = -e * (va - vb) . n

solve the equation to find the collision impulse 'j'

Share this post


Link to post
Share on other sites
Equation with different mass and a coefficient of elasticity is simple enough. With identical mass and perfect inelastic collision (e = 1), you would end up with the same thing. The velocities along the normal of collision are basically swapped around. What I provided you with is the theory behind it.

Share this post


Link to post
Share on other sites
No, the formula that I linked to has nothing to do with the one you wrote.
It calculates final vectors by projecting the initial vectors on the collision line using the dot product

Share this post


Link to post
Share on other sites
Quote:
Original post by captainfreedom
No, the formula that I linked to has nothing to do with the one you wrote.
It calculates final vectors by projecting the initial vectors on the collision line using the dot product


why do I bother sometimes...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!