VR-Forces 4.1.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrfmodel
railMovementDriver.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2010 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
8
11
12
#pragma once
13
14
#include <matrix/vlVector.h>
15
16
class
DtRailSegment
;
17
class
DtVrfMovingObjectStateRepository
;
18
class
DtRailMovementController
;
19
class
DtVrfObject
;
20
24
25
#include "
vrfmodel/vrfmodelDefines.h
"
26
#include "
railObstructionFinder.h
"
27
#include "
railObstructionInfo.h
"
28
#include "
railObstructionAnalyzer.h
"
29
class
DT_DLL_vrfmodel
DtRailMovementDriver
30
{
31
public
:
32
35
DtRailMovementDriver
(
DtRailMovementController
* parentController,
bool
drivingOnLeft,
bool
allowPassing,
36
double
lookAhead,
double
hitTime);
37
39
virtual
~
DtRailMovementDriver
();
40
41
virtual
void
setEntityState(
DtVrfMovingObjectStateRepository
* state);
42
45
virtual
double
findDrivingSpeed(
bool
useAcceleration,
DtVrfObject
* convoyTgt = 0,
const
double
followDist = 0.0,
const
bool
useCatchUpSpeed =
true
);
46
47
virtual
double
calculateCurrentBrakingDistance()
const
;
48
49
virtual
void
setCurrentSegment(
DtRailSegment
* seg);
50
virtual
DtRailSegment
* currentSegment();
51
52
virtual
void
setTurnSpeed(
const
double
speed);
53
virtual
const
double
turnSpeed()
const
;
54
56
virtual
double
determineSpeedGivenObs(
const
double
drivingSpeed,
57
const
double
hitTime,
const
DtRailObstructionPtr
& obs)
const
;
58
59
60
virtual
bool
isSwitchingLeft(
const
int
current,
const
int
passing)
const
;
61
virtual
bool
isSwitchingRight(
const
int
current,
const
int
passing)
const
;
62
64
virtual
int
findClosestLaneToDrivingLane(
const
int
current,
const
int
driving,
const
DtRailSegment
* road)
const
;
65
66
virtual
bool
isObstructionConvoyTarget(
const
int
lane,
DtRailObstructionPtr
&anObstruction,
DtString
convoyTgt)
const
;
67
71
virtual
bool
isLaneObstructed(
const
int
lane,
DtRailObstructionAnalyzer
&analyzer,
72
bool
checkForwardOnly =
false
)
const
;
73
74
virtual
bool
isObstructionStoppedOrSlow(
double
speed,
DtRailObstructionPtr
& obs)
const
;
75
76
virtual
bool
isDrivingLane(
const
int
current,
const
int
driving)
const
;
77
78
79
virtual
int
findOpenLeftLane(
const
int
lane,
const
DtRailSegment
* road,
DtRailObstructionAnalyzer
&analyzer)
const
;
80
81
virtual
int
findOpenRightLane(
const
int
lane,
const
DtRailSegment
* road,
DtRailObstructionAnalyzer
&analyzer)
const
;
82
93
virtual
int
findOpenLane(
const
int
lane,
const
int
passing,
const
DtRailSegment
* road,
94
DtRailObstructionAnalyzer
&analyzer,
bool
checkOpposite =
false
)
const
;
95
97
virtual
bool
isTooCloseToObs(
const
DtRailObstructionPtr
&nextObs,
double
bvRadiusSq )
const
;
98
99
virtual
bool
allowPassing()
100
{
101
return
myAllowPassing;
102
}
103
104
protected
:
105
107
DtRailMovementDriver
();
108
110
DtRailMovementDriver
(
111
const
DtRailMovementDriver
& orig);
112
114
DtRailMovementDriver
& operator=(
115
const
DtRailMovementDriver
& orig);
116
117
protected
:
118
119
bool
myDrivingOnLeft
;
120
bool
myAllowPassing
;
121
122
double
myNearDistanceSq
;
123
bool
myNearTurnPoint
;
124
double
myTurnSpeed
;
125
double
myHitTime
;
126
double
myLookAheadDistance
;
127
128
DtVrfMovingObjectStateRepository
*
myMovingObjectStateRepository
;
129
DtRailMovementController
*
myController
;
130
DtRailSegment
*
myCurrentSegment
;
131
};
132
133
Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)