double FGGroundCallback::GetAGLevel(double t, const FGLocation& loc,
FGLocation& contact, FGColumnVector3& normal,
- FGColumnVector3& vel) const
+ FGColumnVector3& vel, FGColumnVector3& angularVel) const
{
vel = FGColumnVector3(0.0, 0.0, 0.0);
- normal = (-1/FGColumnVector3(loc).Magnitude())*FGColumnVector3(loc);
- double radius = loc.GetRadius();
- double agl = GetAltitude(loc);
- contact = ((radius-agl)/radius)*FGColumnVector3(loc);
+ angularVel = FGColumnVector3(0.0, 0.0, 0.0);
+ normal = FGColumnVector3(loc).Normalize();
+ double loc_radius = loc.GetRadius(); // Get the radius of the given location
+ // (e.g. the CG)
+ double agl = loc_radius - mReferenceRadius;
+ contact = (mReferenceRadius/loc_radius)*FGColumnVector3(loc);
return agl;
}