FGInterface::get_agl_m(double t, const double pt[3], double max_altoff,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
FGInterface::get_agl_m(double t, const double pt[3], double max_altoff,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
{
SGVec3d pt_m = SGVec3d(pt) - max_altoff*ground_cache.get_down();
SGVec3d _contact, _normal, _linearVel, _angularVel;
{
SGVec3d pt_m = SGVec3d(pt) - max_altoff*ground_cache.get_down();
SGVec3d _contact, _normal, _linearVel, _angularVel;
bool ret = ground_cache.get_agl(t, pt_m, _contact, _normal, _linearVel,
bool ret = ground_cache.get_agl(t, pt_m, _contact, _normal, _linearVel,
// correct the linear velocity, since the line intersector delivers
// values for the start point and the get_agl function should
// traditionally deliver for the contact point
// correct the linear velocity, since the line intersector delivers
// values for the start point and the get_agl function should
// traditionally deliver for the contact point
assign(normal, _normal);
assign(linearVel, _linearVel);
assign(angularVel, _angularVel);
assign(normal, _normal);
assign(linearVel, _linearVel);
assign(angularVel, _angularVel);
FGInterface::get_agl_ft(double t, const double pt[3], double max_altoff,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
FGInterface::get_agl_ft(double t, const double pt[3], double max_altoff,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
{
// Convert units and do the real work.
SGVec3d pt_m = SGVec3d(pt) - max_altoff*ground_cache.get_down();
pt_m *= SG_FEET_TO_METER;
SGVec3d _contact, _normal, _linearVel, _angularVel;
{
// Convert units and do the real work.
SGVec3d pt_m = SGVec3d(pt) - max_altoff*ground_cache.get_down();
pt_m *= SG_FEET_TO_METER;
SGVec3d _contact, _normal, _linearVel, _angularVel;
bool ret = ground_cache.get_agl(t, pt_m, _contact, _normal, _linearVel,
bool ret = ground_cache.get_agl(t, pt_m, _contact, _normal, _linearVel,
// correct the linear velocity, since the line intersector delivers
// values for the start point and the get_agl function should
// traditionally deliver for the contact point
// correct the linear velocity, since the line intersector delivers
// values for the start point and the get_agl function should
// traditionally deliver for the contact point
assign( normal, _normal );
assign( linearVel, SG_METER_TO_FEET*_linearVel );
assign( angularVel, _angularVel );
assign( normal, _normal );
assign( linearVel, SG_METER_TO_FEET*_linearVel );
assign( angularVel, _angularVel );
FGInterface::get_nearest_m(double t, const double pt[3], double maxDist,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
FGInterface::get_nearest_m(double t, const double pt[3], double maxDist,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
simgear::BVHNode::Id& id)
{
SGVec3d _contact, _linearVel, _angularVel;
simgear::BVHNode::Id& id)
{
SGVec3d _contact, _linearVel, _angularVel;
if (!ground_cache.get_nearest(t, SGVec3d(pt), maxDist, _contact, _linearVel,
if (!ground_cache.get_nearest(t, SGVec3d(pt), maxDist, _contact, _linearVel,
return false;
assign(contact, _contact);
assign(linearVel, _linearVel);
assign(angularVel, _angularVel);
return false;
assign(contact, _contact);
assign(linearVel, _linearVel);
assign(angularVel, _angularVel);
FGInterface::get_nearest_ft(double t, const double pt[3], double maxDist,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
FGInterface::get_nearest_ft(double t, const double pt[3], double maxDist,
double contact[3], double normal[3],
double linearVel[3], double angularVel[3],
simgear::BVHNode::Id& id)
{
SGVec3d _contact, _linearVel, _angularVel;
simgear::BVHNode::Id& id)
{
SGVec3d _contact, _linearVel, _angularVel;
if (!ground_cache.get_nearest(t, SG_FEET_TO_METER*SGVec3d(pt),
SG_FEET_TO_METER*maxDist, _contact, _linearVel,
if (!ground_cache.get_nearest(t, SG_FEET_TO_METER*SGVec3d(pt),
SG_FEET_TO_METER*maxDist, _contact, _linearVel,
return false;
assign(contact, SG_METER_TO_FEET*_contact);
assign(linearVel, SG_METER_TO_FEET*_linearVel);
assign(angularVel, _angularVel);
return false;
assign(contact, SG_METER_TO_FEET*_contact);
assign(linearVel, SG_METER_TO_FEET*_linearVel);
assign(angularVel, _angularVel);
}
double contact[3], normal[3], vel[3], angvel[3];
}
double contact[3], normal[3], vel[3], angvel[3];
simgear::BVHNode::Id id;
// Ignore the return value here, since it just tells us if
// the returns stem from the groundcache or from the coarse
simgear::BVHNode::Id id;
// Ignore the return value here, since it just tells us if
// the returns stem from the groundcache or from the coarse