5 #include <simgear/scene/material/mat.hxx>
7 #include <FDM/flight.hxx>
12 #include "FGGround.hpp"
15 FGGround::FGGround(FGInterface *iface) : _iface(iface)
24 void FGGround::getGroundPlane(const double pos[3],
25 double plane[4], float vel[3])
27 // Return values for the callback.
28 double cp[3], dvel[3], dangvel[3];
29 const simgear::BVHMaterial* material;
30 simgear::BVHNode::Id id;
31 _iface->get_agl_m(_toff, pos, 2, cp, plane, dvel, dangvel, material, id);
33 // The plane below the actual contact point.
34 plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
36 for(int i=0; i<3; i++) vel[i] = dvel[i];
39 void FGGround::getGroundPlane(const double pos[3],
40 double plane[4], float vel[3],
41 const simgear::BVHMaterial **material)
43 // Return values for the callback.
44 double cp[3], dvel[3], dangvel[3];
45 simgear::BVHNode::Id id;
46 _iface->get_agl_m(_toff, pos, 2, cp, plane, dvel, dangvel, *material, id);
48 // The plane below the actual contact point.
49 plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
51 for(int i=0; i<3; i++) vel[i] = dvel[i];
54 bool FGGround::caughtWire(const double pos[4][3])
56 return _iface->caught_wire_m(_toff, pos);
59 bool FGGround::getWire(double end[2][3], float vel[2][3])
62 bool ret = _iface->get_wire_ends_m(_toff, end, dvel);
63 for (int i=0; i<2; ++i)
64 for (int j=0; j<3; ++j)
65 vel[i][j] = dvel[i][j];
69 void FGGround::releaseWire(void)
71 _iface->release_wire();
74 float FGGround::getCatapult(const double pos[3], double end[2][3],
78 float dist = _iface->get_cat_m(_toff, pos, end, dvel);
79 for (int i=0; i<2; ++i)
80 for (int j=0; j<3; ++j)
81 vel[i][j] = dvel[i][j];
85 void FGGround::setTimeOffset(double toff)