Avionics
Dropship Simulator
Waypoint.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Vehicle.h"
4 
5 
6 
7 class Waypoint
8 {
9 private:
11 
12 public:
14  {
18  };
19 
20  std::string FixId;
22  D3DXVECTOR3 relativeLocation;
23  D3DXVECTOR3 absoluteLocation() const
24  {
25  // rotate based on orientation
26  D3DXMATRIX mOrient;
27  D3DXMatrixRotationQuaternion(&mOrient, &referenceVehicle->orientation);
28  mOrient = referenceVehicle->mBaseOrient * mOrient;
29  D3DXVECTOR3 transformedLocation;
30  D3DXVec3TransformCoord(&transformedLocation, &relativeLocation, &mOrient);
31  return transformedLocation + referenceVehicle->location;
32  }
33 
34  Waypoint(Vehicle* prmReference)
35  {
36  referenceVehicle = prmReference;
37  }
38 };
D3DXVECTOR3 absoluteLocation() const
Definition: Waypoint.h:23
WaypointType
Definition: Waypoint.h:13
WaypointType type
Definition: Waypoint.h:21
D3DXVECTOR3 location
Definition: Vehicle.h:16
D3DXMATRIX mBaseOrient
Definition: Vehicle.h:18
D3DXVECTOR3 relativeLocation
Definition: Waypoint.h:22
Vehicle * referenceVehicle
Definition: Waypoint.h:10
std::string FixId
Definition: Waypoint.h:20
Waypoint(Vehicle *prmReference)
Definition: Waypoint.h:34
D3DXQUATERNION orientation
Definition: Vehicle.h:17
Definition: Vehicle.h:6