| 1 | // AIWakeGroup.hxx -- Group of AI wake meshes for the computation of the induced |
| 2 | // wake. |
| 3 | // |
| 4 | // Written by Bertrand Coconnier, started April 2017. |
| 5 | // |
| 6 | // SPDX-FileCopyrightText: (C) 2017 Bertrand Coconnier - [email protected] |
| 7 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 8 | |
| 9 | #ifndef _FG_AIWAKEGROUP_HXX |
| 10 | #define _FG_AIWAKEGROUP_HXX |
| 11 | |
| 12 | #include <map> |
| 13 | |
| 14 | #include <simgear/math/SGGeod.hxx> |
| 15 | #include <simgear/math/SGQuat.hxx> |
| 16 | #include <simgear/props/propsfwd.hxx> |
| 17 | |
| 18 | #include "FDM/AIWake/WakeMesh.hxx" |
| 19 | |
| 20 | namespace FGTestApi { |
| 21 | namespace PrivateAccessor { |
| 22 | namespace FDM { |
| 23 | class Accessor; |
| 24 | } |
| 25 | } // namespace PrivateAccessor |
| 26 | } // namespace FGTestApi |
| 27 | class FGAIAircraft; |
| 28 | |
| 29 | class AIWakeGroup |
| 30 | { |
| 31 | friend class FGTestApi::PrivateAccessor::FDM::Accessor; |
| 32 | |
| 33 | struct AIWakeData { |
| 34 | explicit AIWakeData(WakeMesh* m = nullptr) : mesh(m) {} |
| 35 | |
| 36 | SGVec3d position{SGVec3d::zeros()}; |
| 37 | SGQuatd Te2b{SGQuatd::unit()}; |
| 38 | bool visited{false}; |
| 39 | WakeMesh_ptr mesh; |
| 40 | }; |
| 41 | |
| 42 | std::map<int, AIWakeData> _aiWakeData; |
| 43 | SGPropertyNode_ptr _density_slugft; |
| 44 | |
| 45 | public: |
| 46 | AIWakeGroup(void); |
| 47 | void AddAI(FGAIAircraft* ai); |
| 48 | SGVec3d getInducedVelocityAt(const SGVec3d& pt) const; |
| 49 | // Garbage collection |
| 50 | void gc(void); |
| 51 | }; |
| 52 | |
| 53 | #endif |