5d18c09c08
I found a small conspicuity in YASim. The destructor of the fdm was never called, therefore a modification of the heli fdm (not in cvs) did not work after reset (I tie some properties and untie them in the destructor, but the destructor was not called and the tieing failed after reset. I don't know if any other parts of YASim need their destructors, at least it wastes memory. Another small fix I have made to the turbulence.cpp. The code needed, that (a-floor(a)) is >=0 and <1. This is analytical correct, but numerical only for "small" values. In normal fg-operation a in this function is always small, but with unrealistic parameters in the aircraft config file it is not and then fg crashes (instead a crash of the aircraft or cataputling it far away).
37 lines
582 B
C++
37 lines
582 B
C++
#ifndef _YASIM_HXX
|
|
#define _YASIM_HXX
|
|
|
|
#include <FDM/flight.hxx>
|
|
|
|
namespace yasim { class FGFDM; };
|
|
|
|
class YASim : public FGInterface {
|
|
public:
|
|
YASim(double dt);
|
|
~YASim();
|
|
|
|
// Load externally set stuff into the FDM
|
|
virtual void init();
|
|
virtual void bind();
|
|
|
|
// Run an iteration
|
|
virtual void update(double dt);
|
|
|
|
private:
|
|
|
|
void report();
|
|
void copyFromYASim();
|
|
void copyToYASim(bool copyState);
|
|
|
|
yasim::FGFDM* _fdm;
|
|
float _dt;
|
|
enum {
|
|
NED,
|
|
UVW,
|
|
KNOTS,
|
|
MACH
|
|
} _speed_set;
|
|
|
|
};
|
|
|
|
#endif // _YASIM_HXX
|