VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrfmodel
surfaceEntityFollowEntityController.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2007 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
8
11
#pragma once
12
13
#include "
vrfobjcore/singleTaskControllerComponent.h
"
14
#include "
vrfutil/scriptGeometry.h
"
15
16
class
DtSimManager
;
17
class
DtSimMessage
;
18
class
DtString
;
19
class
DtSimManager
;
20
class
DtAnalogOutputPort
;
21
class
DtBooleanOutputPort
;
22
class
DtSurfaceEntityActuator
;
23
class
DtVrfMovingObjectStateRepository
;
24
class
DtSurfaceEntityParameters
;
25
class
DtSurfaceEntityPilotControllerDescriptor
;
26
class
DtTaskMessage
;
27
class
DtSurfaceMovementPSR
;
28
30
typedef
enum
31
{
32
surfFollowNoState
,
33
surfFollowFar
,
34
surfFollowBehind
,
35
surfFollowAhead
,
36
surfFollowOver
,
37
surfFollowFacingBack
,
38
surfFollowTurnToStation
39
}
DtSurfFollowState
;
43
44
#include "
vrfmodel/vrfmodelDefines.h
"
45
class
DT_DLL_vrfmodel
DtSurfaceEntityFollowEntityController
:
46
public
DtSingleTaskControllerComponent
47
{
48
49
public
:
50
53
DtSurfaceEntityFollowEntityController
(
const
DtString
& name,
54
DtVrfObject
* owner,
55
DtSimManager
* simManager,
56
DtComponentDescriptor
* desc = 0,
57
DtReaderWriterRegistry
* parentRegistry = 0);
58
62
virtual
~
DtSurfaceEntityFollowEntityController
();
63
66
virtual
const
char
*
type
()
const
;
67
70
virtual
bool
init
();
71
80
static
void
followEntityCallback(
DtSimMessage
* msg,
void
* usrData);
81
88
virtual
void
processFollowEntityTask(
DtSimMessage
* msg);
89
93
virtual
void
registerTaskMsgCallbacks
();
94
95
virtual
void
tick
();
96
99
virtual
void
clearTask
();
101
virtual
bool
createSurfaceControlPortGroup();
102
103
protected
:
110
virtual
bool
setupControlPoint();
111
135
virtual
void
controlMovement();
136
142
virtual
void
moveTowardProjectedStationPosition(
double
distanceToStation,
144
double
approachDistance);
145
153
virtual
void
moveBackToApproachPoint(
bool
onLeftSide,
double
approachDistance,
155
double
turnRadius);
156
163
virtual
void
turnToProjectedStationLine(
164
bool
isOnLeft,
double
radius,
double
distanceToSegment);
165
170
virtual
void
accelToCatchUp(
double
stationSpeed,
double
entitySpeed,
171
double
distanceBehindStation);
172
183
virtual
void
accelToDropBack(
double
stationSpeed,
184
double
entitySpeed,
double
distanceAheadOfStation,
185
double
distanceFromLine);
186
192
virtual
void
turnAtSpeed(
double
desiredHeading,
193
double
desiredSpeed);
194
201
virtual
bool
willOverrunPoint(
double
distanceAhead,
double
distanceFromLine,
202
double
entitySpeed,
double
turnRadius,
double
pointSpeed,
double
maxWaitTime);
203
207
virtual
double
calculateAcceleration(
double
desiredSpeed);
208
212
virtual
double
limitAcceleration(
double
desiredAcceleration,
213
double
desiredSpeed);
214
216
virtual
bool
createPortGroups
();
217
219
virtual
bool
createPorts
();
220
228
virtual
void
lookupAndCacheProcessSR();
229
233
virtual
bool
postAddComponentsInit
();
234
238
virtual
bool
decideToGiveUpTask
()
const
;
239
240
public
:
244
static
DtSimComponent
* creator(
const
DtString
& name,
245
DtVrfObject
* owner,
246
DtSimManager
* simManager,
247
DtComponentDescriptor
* desc = 0,
248
DtReaderWriterRegistry
* parentRegistry = 0);
249
250
protected
:
252
DtSurfaceEntityFollowEntityController
();
253
255
DtSurfaceEntityFollowEntityController
(
256
const
DtSurfaceEntityFollowEntityController
& orig);
257
259
const
DtSurfaceEntityFollowEntityController
&
operator=
(
260
const
DtSurfaceEntityFollowEntityController
& orig);
261
262
protected
:
263
DtVrfMovingObjectStateRepository
*
myEntityState
;
264
DtSurfaceEntityPilotControllerDescriptor
*
myDescriptor
;
265
267
const
DtSurfaceEntityParameters
*
myParameters
;
268
274
DtSurfaceMovementPSR
*
myProcessState
;
275
276
280
DtAnalogOutputPort
*
myAccelerationPort
;
283
DtAnalogOutputPort
*
myClampSpeedPort
;
285
DtAnalogOutputPort
*
myTurnRatePort
;
287
DtAnalogOutputPort
*
myFinalHeadingPort
;
288
292
DtOutputPortGroup
*
mySurfaceControlPortGroup
;
294
295
298
DtVrfObject
*
myLeaderPointer
;
301
302
DtLocation3D
myGeodCurrentPosition
;
303
DtVector2D
myNEStationToEntity
;
304
//? DtVector2D myNEVelocity;
305
306
DtLocation3D
myGeodStationPosition
;
307
DtVector2D
myUnitNEStationDirection
;
308
double
myStationSpeed
;
311
316
DtReal
myApproachSpeed
;
317
323
bool
myIgnoreApproach
;
324
326
DtSurfFollowState
myFollowState
;
327
};
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)