16 static float oldbear = 0.0f;
20 D3DXVECTOR2 result2 = D3DXVECTOR2(result.x, result.y);
21 float dist = D3DXVec2Length(&result2);
22 float bear = atan2f(result2.y, result2.x) - D3DX_PI * 0.5f -
bus->
HeadingTrue;
24 while (bear >= D3DX_PI) bear -= D3DX_PI * 2.0f;
25 while (bear <= -D3DX_PI) bear += D3DX_PI * 2.0f;
29 if (fabsf(oldbear) < D3DX_PI * 0.5f && fabsf(bear) > D3DX_PI * 0.5f)
31 if (dist < 0.5f && nextWaypoint.
type == Waypoint::WaypointType::FinalApproachFix)
36 newCommand.
name =
"AFCS-LateralMode";
37 newCommand.
ivalue =
static_cast<int>(Bus::Afcs::LateralModes::Localizer);
39 newCommand.
name =
"AFCS-ArmLateralMode";
40 newCommand.
ivalue =
static_cast<int>(Bus::Afcs::LateralModes::LateralMode_Off);
47 newCommand.
name =
"AFCS-VerticalMode";
48 newCommand.
ivalue =
static_cast<int>(Bus::Afcs::VerticalModes::GlideSlope);
50 newCommand.
name =
"AFCS-ArmVerticalMode";
51 newCommand.
ivalue =
static_cast<int>(Bus::Afcs::VerticalModes::VerticalMode_Off);
D3DXVECTOR3 absoluteLocation() const
std::vector< Command > commandStream
std::vector< Waypoint > waypoints
float HeadingTrue
(4) Heading–primary flight crew reference (if selectable, record discrete, true or magnetic); ...
std::string name
command name
Abstract base class for modules By definition, instruments don't do any of the work (they don't modif...
Fms(Bus *prmBus, Logger *prmLogger)
enum Bus::Afcs::VerticalModes StandbyVerticalMode
void FrameMove(float fElapsedTime) override
enum Bus::Afcs::LateralModes StandbyLateralMode