5#include <simgear/scene/material/mat.hxx>
12#include "FGGround.hpp"
15FGGround::FGGround(FGInterface *iface) : _iface(iface)
24void FGGround::getGroundPlane(
const double pos[3],
25 double plane[4],
float vel[3],
29 double cp[3], dvel[3], dangvel[3];
30 const simgear::BVHMaterial* material;
31 _iface->get_agl_m(_toff, pos, 2, cp, plane, dvel, dangvel, material, body);
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];
39void FGGround::getGroundPlane(
const double pos[3],
40 double plane[4],
float vel[3],
41 const simgear::BVHMaterial **material,
45 double cp[3], dvel[3], dangvel[3];
46 _iface->get_agl_m(_toff, pos, 2, cp, plane, dvel, dangvel, *material, body);
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];
54bool FGGround::getBody(
double t,
double bodyToWorld[16],
double linearVel[3],
55 double angularVel[3],
unsigned int &body)
57 if (!_iface->get_body_m(_toff + t , body, bodyToWorld, linearVel, angularVel))
63bool FGGround::caughtWire(
const double pos[4][3])
65 return _iface->caught_wire_m(_toff, pos);
68bool FGGround::getWire(
double end[2][3],
float vel[2][3])
71 bool ret = _iface->get_wire_ends_m(_toff, end, dvel);
72 for (
int i=0;
i<2; ++
i)
73 for (
int j=0; j<3; ++j)
74 vel[
i][j] = dvel[
i][j];
78void FGGround::releaseWire(
void)
80 _iface->release_wire();
83float FGGround::getCatapult(
const double pos[3],
double end[2][3],
87 float dist = _iface->get_cat_m(_toff, pos, end, dvel);
88 for (
int i=0;
i<2; ++
i)
89 for (
int j=0; j<3; ++j)
90 vel[
i][j] = dvel[
i][j];
94void FGGround::setTimeOffset(
double toff)