#define _INST_RADALT_HXX
#include <simgear/structure/subsystem_mgr.hxx>
-#include <Scenery/scenery.hxx>
-#include <simgear/scene/material/mat.hxx>
+#include <simgear/props/props.hxx>
+#include <simgear/math/SGMath.hxx>
-#include <Cockpit/agradar.hxx>
-
-class radAlt : public agRadar{
+class RadarAltimeter : public SGSubsystem
+{
public:
- radAlt ( SGPropertyNode *node );
- radAlt ();
- virtual ~radAlt ();
+ RadarAltimeter ( SGPropertyNode *node );
+ virtual ~RadarAltimeter ();
private:
virtual void update (double dt);
void update_altitude();
- double getDistanceAntennaToHit(SGVec3d h) const;
-
+ void updateSetHeight();
+
+ double getDistanceAntennaToHit(const SGVec3d& h) const;
+ SGVec3d getCartAntennaPos()const;
+
+ SGVec3d rayVector(double az, double el) const;
+
+ SGPropertyNode_ptr _Instrument;
SGPropertyNode_ptr _user_alt_agl_node;
SGPropertyNode_ptr _rad_alt_warning_node;
+ SGPropertyNode_ptr _serviceable_node;
+ SGPropertyNode_ptr _sceneryLoaded;
+
+
+ SGVec3d _antennaOffset; // in aircraft local XYZ frame
+
+ std::string _name;
+ int _num;
+ double _time;
+ double _interval;
double _min_radalt;