Fix Yasim ground interface recursion bug
The base (non-FlightGear) implementation of YASim ground getBody would always call itself. Fortunately we always replace it with the FG-specific subclass (FGGround).
This commit is contained in:
parent
7fe641f3b3
commit
7811b11565
3 changed files with 15 additions and 25 deletions
|
@ -18,26 +18,26 @@ public:
|
||||||
FGGround(FGInterface *iface);
|
FGGround(FGInterface *iface);
|
||||||
virtual ~FGGround();
|
virtual ~FGGround();
|
||||||
|
|
||||||
virtual void getGroundPlane(const double pos[3],
|
void getGroundPlane(const double pos[3],
|
||||||
double plane[4], float vel[3],
|
double plane[4], float vel[3],
|
||||||
unsigned int &body);
|
unsigned int &body) override;
|
||||||
|
|
||||||
virtual void getGroundPlane(const double pos[3],
|
void getGroundPlane(const double pos[3],
|
||||||
double plane[4], float vel[3],
|
double plane[4], float vel[3],
|
||||||
const simgear::BVHMaterial **material,
|
const simgear::BVHMaterial **material,
|
||||||
unsigned int &body);
|
unsigned int &body) override;
|
||||||
|
|
||||||
virtual bool getBody(double t, double bodyToWorld[16], double linearVel[3],
|
bool getBody(double t, double bodyToWorld[16], double linearVel[3],
|
||||||
double angularVel[3], unsigned int &id);
|
double angularVel[3], unsigned int &id) override;
|
||||||
|
|
||||||
virtual bool caughtWire(const double pos[4][3]);
|
bool caughtWire(const double pos[4][3]) override;
|
||||||
|
|
||||||
virtual bool getWire(double end[2][3], float vel[2][3]);
|
bool getWire(double end[2][3], float vel[2][3]) override;
|
||||||
|
|
||||||
virtual void releaseWire(void);
|
void releaseWire(void) override;
|
||||||
|
|
||||||
virtual float getCatapult(const double pos[3],
|
float getCatapult(const double pos[3],
|
||||||
double end[2][3], float vel[2][3]);
|
double end[2][3], float vel[2][3]) override;
|
||||||
|
|
||||||
void setTimeOffset(double toff);
|
void setTimeOffset(double toff);
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,6 @@
|
||||||
#include "Ground.hpp"
|
#include "Ground.hpp"
|
||||||
namespace yasim {
|
namespace yasim {
|
||||||
|
|
||||||
Ground::Ground()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Ground::~Ground()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Ground::getGroundPlane(const double pos[3],
|
void Ground::getGroundPlane(const double pos[3],
|
||||||
double plane[4], float vel[3],
|
double plane[4], float vel[3],
|
||||||
unsigned int &body)
|
unsigned int &body)
|
||||||
|
@ -47,8 +39,7 @@ void Ground::getGroundPlane(const double pos[3],
|
||||||
bool Ground::getBody(double t, double bodyToWorld[16], double linearVel[3],
|
bool Ground::getBody(double t, double bodyToWorld[16], double linearVel[3],
|
||||||
double angularVel[3], unsigned int &body)
|
double angularVel[3], unsigned int &body)
|
||||||
{
|
{
|
||||||
return getBody(t, bodyToWorld, linearVel,
|
return false;
|
||||||
angularVel, body);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Ground::caughtWire(const double pos[4][3])
|
bool Ground::caughtWire(const double pos[4][3])
|
||||||
|
|
|
@ -8,8 +8,7 @@ namespace yasim {
|
||||||
|
|
||||||
class Ground {
|
class Ground {
|
||||||
public:
|
public:
|
||||||
Ground();
|
virtual ~Ground() = default;
|
||||||
virtual ~Ground();
|
|
||||||
|
|
||||||
virtual void getGroundPlane(const double pos[3],
|
virtual void getGroundPlane(const double pos[3],
|
||||||
double plane[4], float vel[3],
|
double plane[4], float vel[3],
|
||||||
|
|
Loading…
Add table
Reference in a new issue