Rise
The Vieneo Province
Loading...
Searching...
No Matches
TurnByTurn Class Reference

#include <TurnByTurn.h>

Collaboration diagram for TurnByTurn:
[legend]

Public Member Functions

 TurnByTurn (Bus *pBus, Logger *pLoggger, Networking *pNetworking)
 ~TurnByTurn ()
void Update (bool pIsGrndVehicle, float pElasedTime)
void Draw (Rendering::RenderDevice *pd3dDevice, const StreetMapProjection &map)
void UpdateVB (const StreetMapProjection &map)
void CreateVB (Rendering::RenderDevice *pd3dDevice)
Direction GetDirection (float bearing) const
float GetHeadingToNextNode () const
void ReleaseResources ()

Private Types

enum  UpdateType {
  TYPE_APPROACHING_NEXT_NODE = 0 , TYPE_NEXT_NODE = 1 , TYPE_CONTINUE_TO_NEXT_NODE = 2 , TYPE_RECALCULATING = 4 ,
  TYPE_NAVIGATION_COMPLETED = 5 , TYPE_MAPPED_ROUTE_ENDED = 6
}
enum  Direction {
  STRAIGHT = 0 , BEAR_LEFT = 1 , TURN_LEFT = 2 , BEAR_RIGHT = 3 ,
  TURN_RIGHT = 4 , U_TURN = 5
}

Private Member Functions

void sendUpdateToServer (int pEdgeId, float pDistance, float pDirection, UpdateType pType) const
void Trace (char *msg, Logger::Level severity=Logger::Level::Info) const

Static Private Member Functions

static float angleBetweenPositionsDeg (const RiseMath::Vector2 &vectorA, const RiseMath::Vector2 &vectorB)
static float distanceBetweenPositions (const RiseMath::Vector2 &vectorA, const RiseMath::Vector2 &vectorB)
static float convertDistanceToMeters (float dist)
static float vectorToDegrees (const RiseMath::Vector2 &vec)
static float getHeadingChange (float targetHeading, float currentHeading)
static float customModulo (float a, float n)

Private Attributes

Bus * bus = nullptr
Logger * logger = nullptr
Networking * networking = nullptr
Rendering::RenderBuffer * m_avRouteMap = nullptr
RiseMath::Vector2 vehiclePosTcp
size_t nextNodeIndex = 0
int routeWaypointId = 0
size_t lineCount = 0
RouteGuidance guidance

Detailed Description

Definition at line 8 of file TurnByTurn.h.

Member Enumeration Documentation

◆ Direction

enum TurnByTurn::Direction
private
Enumerator
STRAIGHT 
BEAR_LEFT 
TURN_LEFT 
BEAR_RIGHT 
TURN_RIGHT 
U_TURN 

Definition at line 32 of file TurnByTurn.h.

◆ UpdateType

enum TurnByTurn::UpdateType
private
Enumerator
TYPE_APPROACHING_NEXT_NODE 
TYPE_NEXT_NODE 
TYPE_CONTINUE_TO_NEXT_NODE 
TYPE_RECALCULATING 
TYPE_NAVIGATION_COMPLETED 
TYPE_MAPPED_ROUTE_ENDED 

Definition at line 22 of file TurnByTurn.h.

Constructor & Destructor Documentation

◆ TurnByTurn()

TurnByTurn::TurnByTurn ( Bus * pBus,
Logger * pLoggger,
Networking * pNetworking )

Definition at line 4 of file TurnByTurn.cpp.

Here is the call graph for this function:

◆ ~TurnByTurn()

TurnByTurn::~TurnByTurn ( )

Definition at line 12 of file TurnByTurn.cpp.

Member Function Documentation

◆ angleBetweenPositionsDeg()

float TurnByTurn::angleBetweenPositionsDeg ( const RiseMath::Vector2 & vectorA,
const RiseMath::Vector2 & vectorB )
staticprivate

Definition at line 237 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertDistanceToMeters()

float TurnByTurn::convertDistanceToMeters ( float dist)
staticprivate

Definition at line 265 of file TurnByTurn.cpp.

◆ CreateVB()

void TurnByTurn::CreateVB ( Rendering::RenderDevice * pd3dDevice)

Definition at line 138 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ customModulo()

float TurnByTurn::customModulo ( float a,
float n )
staticprivate

Definition at line 280 of file TurnByTurn.cpp.

Here is the caller graph for this function:

◆ distanceBetweenPositions()

float TurnByTurn::distanceBetweenPositions ( const RiseMath::Vector2 & vectorA,
const RiseMath::Vector2 & vectorB )
staticprivate

Definition at line 259 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Draw()

void TurnByTurn::Draw ( Rendering::RenderDevice * pd3dDevice,
const StreetMapProjection & map )

Definition at line 95 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDirection()

TurnByTurn::Direction TurnByTurn::GetDirection ( float bearing) const

Definition at line 214 of file TurnByTurn.cpp.

◆ getHeadingChange()

float TurnByTurn::getHeadingChange ( float targetHeading,
float currentHeading )
staticprivate

Definition at line 271 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHeadingToNextNode()

float TurnByTurn::GetHeadingToNextNode ( ) const

Definition at line 231 of file TurnByTurn.cpp.

Here is the call graph for this function:

◆ ReleaseResources()

void TurnByTurn::ReleaseResources ( )

Definition at line 193 of file TurnByTurn.cpp.

Here is the caller graph for this function:

◆ sendUpdateToServer()

void TurnByTurn::sendUpdateToServer ( int pEdgeId,
float pDistance,
float pDirection,
UpdateType pType ) const
private

Definition at line 199 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Trace()

void TurnByTurn::Trace ( char * msg,
Logger::Level severity = Logger::Level::Info ) const
private

Definition at line 285 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update()

void TurnByTurn::Update ( bool pIsGrndVehicle,
float pElasedTime )

Definition at line 17 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateVB()

void TurnByTurn::UpdateVB ( const StreetMapProjection & map)

Definition at line 161 of file TurnByTurn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vectorToDegrees()

float TurnByTurn::vectorToDegrees ( const RiseMath::Vector2 & vec)
staticprivate

Definition at line 245 of file TurnByTurn.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ bus

Bus* TurnByTurn::bus = nullptr
private

Definition at line 11 of file TurnByTurn.h.

◆ guidance

RouteGuidance TurnByTurn::guidance
private

Definition at line 20 of file TurnByTurn.h.

◆ lineCount

size_t TurnByTurn::lineCount = 0
private

Definition at line 19 of file TurnByTurn.h.

◆ logger

Logger* TurnByTurn::logger = nullptr
private

Definition at line 12 of file TurnByTurn.h.

◆ m_avRouteMap

Rendering::RenderBuffer* TurnByTurn::m_avRouteMap = nullptr
private

Definition at line 14 of file TurnByTurn.h.

◆ networking

Networking* TurnByTurn::networking = nullptr
private

Definition at line 13 of file TurnByTurn.h.

◆ nextNodeIndex

size_t TurnByTurn::nextNodeIndex = 0
private

Definition at line 17 of file TurnByTurn.h.

◆ routeWaypointId

int TurnByTurn::routeWaypointId = 0
private

Definition at line 18 of file TurnByTurn.h.

◆ vehiclePosTcp

RiseMath::Vector2 TurnByTurn::vehiclePosTcp
private

Definition at line 16 of file TurnByTurn.h.


The documentation for this class was generated from the following files: