All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TrafficCongestionVehicleModel.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "VectorMathDecl.h"
7 #include "Navigation.h"
8 #include "Traffic.h"
9 #include "Camera.h"
10 #include <string>
11 
12 namespace Eegeo
13 {
14  namespace TrafficCongestion
15  {
16  namespace VehicleDirection
17  {
18  // This is used so that we know which direction the individual congestion vehicle is travelling in.
19  enum DirectionValues
20  {
21  FromTo = 0,
22  ToFrom,
23  };
24  }
25 
27  {
28  private:
29  VehicleDirection::DirectionValues m_directionOfTravel;
30  int m_segmentIndex;
31  float m_distanceTravelledAlongCurrentSegment;
32  float m_speedMultiplier;
33  const std::string& m_modelNodeName;
34  std::string m_modelFullName;
35  float m_scale;
36  bool m_drivesOnRight;
37 
38  void SubmitRenderData(
39  dv3 ecefCellOrigin,
40  const std::vector<v3>& vertices,
41  float roadHalfWidth,
42  Traffic::VehicleRenderablesModel& vehicleRenderablesModel,
43  const dv3& cameraEcefLocation);
44 
45  int GetNextSegmentId(int segmentVertexCount) const;
46 
47  public:
49  VehicleDirection::DirectionValues directionOfTravel,
50  int segmentIndex,
51  float distanceTravelled,
52  float speedMultiplier,
53  const std::string& modelNodeName,
54  const std::string& modelNodeSuffix,
55  float scale,
56  bool drivesOnRight
57  );
58 
60 
61  void Update(
62  float dt,
63  Eegeo::dv3 ecefCellOrigin,
65  Eegeo::Traffic::VehicleRenderablesModel& vehicleRenderablesModel,
66  const dv3& cameraEcefLocation);
67 
68  void SetModelNodeNameSuffix(const std::string& suffix);
69  void SetDrivesOnRight(bool drivesOnRight);
70  };
71  }
72 }