Sphere to sphere angular collision response?

Started by
-1 comments, last by johnnyBravo 16 years, 11 months ago
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]

This topic is closed to new replies.

Advertisement