Jump to content
  • Advertisement
Sign in to follow this  

Sphere to sphere angular collision response?

This topic is 4090 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

Hi, I've implemented the linear collision response between two rigid spheres, but I am unsure of where to start with the angular response. I've got my two tangential vectors that were untouched by the linear response, what exactly should I be doing with them for the angular response? Thanks edit: heres some code I pulled from someones billiards game for the angular collision response
//w1i = initial angular vel
//w2i = initial angular vel

//all the r1,r2, m1, m2 were just m an r in his code, as
//in billiards they're all the same

//radius normal
Vector rn1 = n * r1;
Vector rn2 = n * -1.0 * r2;

//perimetre velocity
Vector vp1 = rn1.cross(w1i);
Vector vp2 = rn2.cross(w2i);

Vector vpr1 = vp1 - vp2;
Vector vpr2 = vp2 - vp1;

//frictional force
double friction = 1.5;

///vn1i,vn2i is the normal vel
///vt1, vt2 is the tangential vel
Vector ff1 = (vpr1+vt1).normal()*-friction*m1*(vn1i-vn2i).length();
Vector ff2 = (vpr2+vt2).normal()*  -friction*m2*(vn1i-vn2i).length();

//I don't understand what this is for
double impulse_time = .05;

Vector w1f = (n*-1.0*r1).cross(ff1) * (5*impulse_time/(2*m1*r1*r1));
Vector w2f = (n*r2).cross(ff2) * (5*impulse_time/(2*m2*r2*r2));

Though theres a problem with it where if a sphere has no linear AND no angular vel, that sphere will be given 0 for new vel even though the other one will get some new vel, the one that was moving that is. I got that source from here (near the bottom) [Edited by - johnnyBravo on May 8, 2007 6:20:18 AM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!