| 1 | // Air Ground Radar |
| 2 | // |
| 3 | // Written by Vivian MEAZZA, started Feb 2008. |
| 4 | // |
| 5 | // |
| 6 | // Copyright (C) 2008 Vivain MEAZZA - [email protected] |
| 7 | // |
| 8 | // This program is free software; you can redistribute it and/or |
| 9 | // modify it under the terms of the GNU General Public License as |
| 10 | // published by the Free Software Foundation; either version 2 of the |
| 11 | // License, or (at your option) any later version. |
| 12 | // |
| 13 | // This program is distributed in the hope that it will be useful, but |
| 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | // General Public License for more details. |
| 17 | // |
| 18 | // You should have received a copy of the GNU General Public License |
| 19 | // along with this program; if not, write to the Free Software |
| 20 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 21 | // |
| 22 | // |
| 23 | |
| 24 | #ifndef _INST_AGRADAR_HXX |
| 25 | #define _INST_AGRADAR_HXX |
| 26 | |
| 27 | #include <simgear/structure/subsystem_mgr.hxx> |
| 28 | #include <Scenery/scenery.hxx> |
| 29 | #include <simgear/scene/material/mat.hxx> |
| 30 | |
| 31 | #include "wxradar.hxx" |
| 32 | |
| 33 | class agRadar : public wxRadarBg |
| 34 | { |
| 35 | public: |
| 36 | agRadar ( SGPropertyNode *node ); |
| 37 | agRadar (); |
| 38 | virtual ~agRadar (); |
| 39 | |
| 40 | // Subsystem API. |
| 41 | void init() override; |
| 42 | void update(double dt) override; |
| 43 | |
| 44 | // Subsystem identification. |
| 45 | static const char* staticSubsystemClassId() { return "air-ground-radar"; } |
| 46 | |
| 47 | void setUserPos(); |
| 48 | void setUserVec(double az, double el); |
| 49 | void update_terrain(); |
| 50 | void setAntennaPos(); |
| 51 | |
| 52 | bool getMaterial(); |
| 53 | |
| 54 | double _load_resistance; // ground load resistanc N/m^2 |
| 55 | double _frictionFactor; // dimensionless modifier for Coefficient of Friction |
| 56 | double _bumpinessFactor; // dimensionless modifier for Bumpiness |
| 57 | double _elevation_m; // ground elevation in meters |
| 58 | bool _solid; // if true ground is solid for FDMs |
| 59 | |
| 60 | std::string _mat_name; // ground material |
| 61 | |
| 62 | SGVec3d getCartUserPos() const; |
| 63 | SGVec3d getCartAntennaPos()const; |
| 64 | |
| 65 | SGVec3d uservec; |
| 66 | |
| 67 | SGPropertyNode_ptr _user_hdg_deg_node; |
| 68 | SGPropertyNode_ptr _user_roll_deg_node; |
| 69 | SGPropertyNode_ptr _user_pitch_deg_node; |
| 70 | SGPropertyNode_ptr _terrain_warning_node; |
| 71 | |
| 72 | SGPropertyNode_ptr _xOffsetMNode; |
| 73 | SGPropertyNode_ptr _yOffsetMNode; |
| 74 | SGPropertyNode_ptr _zOffsetMNode; |
| 75 | |
| 76 | SGPropertyNode_ptr _elevLimitDegNode; |
| 77 | SGPropertyNode_ptr _elevStepDegNode; |
| 78 | SGPropertyNode_ptr _azLimitDegNode; |
| 79 | SGPropertyNode_ptr _azStepDegNode; |
| 80 | SGPropertyNode_ptr _maxRangeMNode; |
| 81 | SGPropertyNode_ptr _minRangeMNode; |
| 82 | SGPropertyNode_ptr _tiltNode; |
| 83 | |
| 84 | SGPropertyNode_ptr _brgDegNode; |
| 85 | SGPropertyNode_ptr _rangeMNode; |
| 86 | SGPropertyNode_ptr _elevationMNode; |
| 87 | SGPropertyNode_ptr _materialNode; |
| 88 | SGPropertyNode_ptr _bumpinessNode; |
| 89 | |
| 90 | SGPropertyNode_ptr _rollStabNode; |
| 91 | SGPropertyNode_ptr _pitchStabNode; |
| 92 | |
| 93 | SGGeod userpos; |
| 94 | SGGeod hitpos; |
| 95 | SGGeod antennapos; |
| 96 | }; |
| 97 | |
| 98 | #endif // _INST_AGRADAR_HXX |