1 #include <FDM/flight.hxx>
6 #include "FGGround.hpp"
9 FGGround::FGGround(FGInterface *iface) : _iface(iface)
18 void FGGround::getGroundPlane(const double pos[3],
19 double plane[4], float vel[3])
21 // Return values for the callback.
22 double loadCapacity, frictionFactor, agl;
23 double cp[3], dvel[3];
25 _iface->get_agl_m(_toff, pos, cp, plane, dvel,
26 &type, &loadCapacity, &frictionFactor, &agl);
28 // The plane below the actual contact point.
29 plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
31 for(int i=0; i<3; i++) vel[i] = dvel[i];
34 bool FGGround::caughtWire(const double pos[4][3])
36 return _iface->caught_wire_m(_toff, pos);
39 bool FGGround::getWire(double end[2][3], float vel[2][3])
42 bool ret = _iface->get_wire_ends_m(_toff, end, dvel);
43 for (int i=0; i<2; ++i)
44 for (int j=0; j<3; ++j)
45 vel[i][j] = dvel[i][j];
49 void FGGround::releaseWire(void)
51 _iface->release_wire();
54 float FGGround::getCatapult(const double pos[3], double end[2][3],
58 float dist = _iface->get_cat_m(_toff, pos, end, dvel);
59 for (int i=0; i<2; ++i)
60 for (int j=0; j<3; ++j)
61 vel[i][j] = dvel[i][j];
65 void FGGround::setTimeOffset(double toff)