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