All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PlaneVehicle.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "VectorMath.h"
7 #include "Traffic.h"
8 #include "Camera.h"
9 #include "Random.h"
10 #include "Streaming.h"
11 #include "TrafficSimulationConfiguration.h"
12 #include "Helpers.h"
13 #include <string>
14 
15 namespace Eegeo
16 {
17  namespace Traffic
18  {
19  class PlaneVehicle : protected Eegeo::NonCopyable
20  {
21  private:
22  float m_timeOutsideViewVolume;
23  std::string m_fullModelNodeName;
24 
25  float m_currentHeightAboveTerrain;
26  float m_currentTerrainHeight;
27  float m_targetTerrainHeight;
28  dv3 m_surfacePosition;
29 
30  public:
31 
32  dv3 position;
33  v3 forward;
34  v3 localY;
36 
37  PlaneVehicle(dv3 &startPositionOnSurface,
38  float initialTerrainHeight,
39  float heightAboveTerrain,
40  v3 &forwardDirection,
41  v3 &up,
43  const std::string & modelNodeNameSuffix);
44 
45  void SetModelNodeNameSuffix(const std::string & modelNodeNameSuffix);
46  std::string& GetFullModelNodeName();
47 
48  void SetTerrainHeight(const float terrainHeight);
49 
50  void Update(float deltaSeconds, float speedMultiplier, float planeCullingSphereRadius, Streaming::CameraFrustumStreamingVolume& streamingVolume, float currentFlatteningScale);
51 
52  bool ShouldDispose(float maxTimeOutsideViewVolumeBeforeDespawn);
53 
54  static PlaneVehicle * CreateAtHeight(float initialTerrainHeight,
55  float heightAboveTerrain,
56  const Camera::RenderCamera& renderCamera,
57  Random & randomGenerator,
58  const Helpers::RouletteWheelSelector& selector,
60  const std::string & modelNameSuffix);
61  };
62  }
63 }