]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Ground.cpp
Port over remaining Point3D usage to the more type and unit safe SG* classes.
[flightgear.git] / src / FDM / YASim / Ground.cpp
1 #include "Glue.hpp"
2
3 #include <simgear/scene/material/mat.hxx>
4 #include "Ground.hpp"
5 namespace yasim {
6
7 Ground::Ground()
8 {
9 }
10
11 Ground::~Ground()
12 {
13 }
14
15 void Ground::getGroundPlane(const double pos[3],
16                             double plane[4], float vel[3])
17 {
18     // ground.  Calculate a cartesian coordinate for the ground under
19     // us, find the (geodetic) up vector normal to the ground, then
20     // use that to find the final (radius) term of the plane equation.
21     float up[3];
22     Glue::geodUp((double*)pos, up);
23     int i;
24     for(i=0; i<3; i++) plane[i] = up[i];
25     plane[3] = plane[0]*pos[0] + plane[1]*pos[1] + plane[2]*pos[2];
26
27     vel[0] = 0.0;
28     vel[1] = 0.0;
29     vel[2] = 0.0;
30 }
31
32 void Ground::getGroundPlane(const double pos[3],
33                             double plane[4], float vel[3],
34                             const SGMaterial **material)
35 {
36     getGroundPlane(pos,plane,vel);
37 }
38
39 bool Ground::caughtWire(const double pos[4][3])
40 {
41     return false;
42 }
43
44 bool Ground::getWire(double end[2][3], float vel[2][3])
45 {
46     return false;
47 }
48
49 void Ground::releaseWire(void)
50 {
51 }
52
53 float Ground::getCatapult(const double pos[3], double end[2][3],
54                           float vel[2][3])
55 {
56     return 1e10;
57 }
58
59 }; // namespace yasim
60