5 #include <FDM/flight.hxx>
10 #include "FGGround.hpp"
13 FGGround::FGGround(FGInterface *iface) : _iface(iface)
22 void FGGround::getGroundPlane(const double pos[3],
23 double plane[4], float vel[3])
25 // Return values for the callback.
26 double loadCapacity, frictionFactor, agl;
27 double cp[3], dvel[3];
29 _iface->get_agl_m(_toff, pos, cp, plane, dvel,
30 &type, &loadCapacity, &frictionFactor, &agl);
32 // The plane below the actual contact point.
33 plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
35 for(int i=0; i<3; i++) vel[i] = dvel[i];
38 void FGGround::getGroundPlane(const double pos[3],
39 double plane[4], float vel[3],
40 int *type, const SGMaterial **material
43 // Return values for the callback.
45 double cp[3], dvel[3];
46 _iface->get_agl_m(_toff, pos, cp, plane, dvel,
47 type, material, &agl);
49 // The plane below the actual contact point.
50 plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
52 for(int i=0; i<3; i++) vel[i] = dvel[i];
55 bool FGGround::caughtWire(const double pos[4][3])
57 return _iface->caught_wire_m(_toff, pos);
60 bool FGGround::getWire(double end[2][3], float vel[2][3])
63 bool ret = _iface->get_wire_ends_m(_toff, end, dvel);
64 for (int i=0; i<2; ++i)
65 for (int j=0; j<3; ++j)
66 vel[i][j] = dvel[i][j];
70 void FGGround::releaseWire(void)
72 _iface->release_wire();
75 float FGGround::getCatapult(const double pos[3], double end[2][3],
79 float dist = _iface->get_cat_m(_toff, pos, end, dvel);
80 for (int i=0; i<2; ++i)
81 for (int j=0; j<3; ++j)
82 vel[i][j] = dvel[i][j];
86 void FGGround::setTimeOffset(double toff)