Original Post
hi, i don't know if any of you read "Physics on the Back of a Cocktail Napkin" from http://www.gamasutra.com/features/20000516/lander_01.htm but im having lots of trouble to figure out how he applied the physics in the small demo program he gives...Basically, he says that to to verify if a ball is rolling or sliding, it has to satisfy "v = Rw" where w is the angular velocity, yet in his demo program he doesn't calculate that velocity anywhere, instead he does this :
FdotN = g_Gravity.y / curBall->oneOverM; // Gravity
// Calculate Vt Velocity Tangent to Normal Plane
MAKEVECTOR(contactN,0.0f, 1.0f, 0.0f)
VdotN = DotProduct(&contactN,&curBall->v);
ScaleVector(&contactN, VdotN, &Vn);
VectorDifference(&curBall->v, &Vn, &Vt);
Vmag = VectorSquaredLength(&Vt);
// Check if Velocity is faster then threshold
if (Vmag > STATIC_THRESHOLD) // Use Kinetic Friction model
{
NormalizeVector(&Vt);
ScaleVector(&Vt, (FdotN * g_Ckf), &Vt);
VectorSum(&curBall->f,&Vt,&curBall->f);
}
else // Use Static Friction Model
{
Vmag = Vmag / STATIC_THRESHOLD;
NormalizeVector(&Vt);
ScaleVector(&Vt, (FdotN * g_Csf * Vmag), &Vt); // Scale Friction by Velocity
VectorSum(&curBall->f,&Vt,&curBall->f);
im really having trouble to understand what he does in this code to verify if the ball is rolling or not...anyone good at physics could help me out...im really desesperate here :(