VR-Forces 4.2 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrfmodel
aggregatedMoveAlongController.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
8
9
#pragma once
10
11
#include "
vrfobjcore/singleTaskControllerComponent.h
"
12
13
class
DtCgf
;
14
class
DtAnalogOutputPort
;
15
class
DtVectorOutputPort
;
16
class
DtVrfAggregateStateRepository
;
17
class
DtAggregatedMoveAlongPSR
;
18
22
#include "
vrfmodel/vrfmodelDefines.h
"
23
class
DT_DLL_vrfmodel
DtAggregatedMoveAlongController
:
public
DtSingleTaskControllerComponent
24
{
25
private
:
27
DtAggregatedMoveAlongController
();
29
DtAggregatedMoveAlongController
(
const
DtAggregatedMoveAlongController
& orig);
31
DtAggregatedMoveAlongController
&
operator=
(
32
const
DtAggregatedMoveAlongController
& orig);
33
public
:
35
DtAggregatedMoveAlongController
(
const
DtString
& name,
DtVrfObject
* owner,
36
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
37
DtReaderWriterRegistry
*parentRegistry=0);
38
40
virtual
~
DtAggregatedMoveAlongController
();
41
43
virtual
bool
init
();
44
46
virtual
DtString
type
()
const
;
47
51
virtual
void
preFirstTickInit
();
52
54
virtual
void
tick
();
55
59
static
void
routeChangedCallback(
DtVrfObject
* obj,
void
* usr);
60
virtual
void
processRouteChanged(
DtVrfObject
* obj);
61
63
virtual
void
registerTaskMsgCallbacks
();
64
65
static
void
moveAlongCallback(
DtSimMessage
* msg,
void
* usr,
DtSimTaskStatePtr
taskStatePtr);
66
74
virtual
bool
setupRoute();
75
82
virtual
bool
setupDestination();
83
85
virtual
double
findDesiredSpeed();
86
92
virtual
void
stop();
93
95
static
void
objectAddedCb(
DtVrfObject
* vrfObject,
void
* usr);
96
98
static
DtSimComponent
* creator(
const
DtString
& name,
DtVrfObject
* owner,
99
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
100
DtReaderWriterRegistry
* parentRegistry=0);
101
103
virtual
bool
createPorts
();
104
106
virtual
bool
createPortGroups
();
107
113
virtual
bool
createPSR();
114
117
virtual
void
doMoving();
118
120
virtual
double
findDesiredHeading();
121
123
//virtual bool destinationIsInsideObstruction(
125
128
//virtual bool decideToGiveUpTask() const;
129
130
protected
:
131
virtual
void
processMoveAlong(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
132
136
virtual
void
buildLocalRoute();
137
140
virtual
void
emptyVertexList();
141
145
virtual
void
processObjectAdded(
DtVrfObject
* vrfObject);
146
149
virtual
void
clearTask
();
150
152
virtual
void
moveToDestination();
153
155
virtual
void
invalidateDestinationVector()
const
;
156
virtual
double
distanceToDestination()
const
;
157
166
virtual
bool
atDestination();
167
177
virtual
bool
passedDestination();
178
187
virtual
bool
getDestination(
DtVector
& destination);
188
193
virtual
const
DtVector
& destinationVector()
const
;
194
203
virtual
void
setupDestinationVector()
const
;
204
209
virtual
double
atDistance()
const
;
210
216
virtual
bool
stayOnRoute()
const
;
217
223
virtual
double
minCorrectionDistance()
const
;
224
232
virtual
double
maxCorrectionDistance()
const
;
233
237
virtual
double
maxCorrectionAngle()
const
;
238
242
virtual
bool
getCurrentRouteSegment(
DtVector
& routeSegmentStart,
243
DtVector
& routeSegmentEnd)
const
;
244
245
DtSimTaskStatePtr
currentTaskState
()
const
;
246
247
protected
:
248
251
DtOutputPortGroup
*
myMovementControlPortGroup
;
256
DtAnalogOutputPort
*
mySpeedPort
;
257
262
DtAnalogOutputPort
*
myMovementDirectionPort
;
263
269
DtVectorOutputPort
*
myDestinationOutputPort
;
270
271
DtVrfAggregateStateRepository
*
myTrueAggregateRepository
;
272
275
DtAggregatedMoveAlongPSR
*
myProcessState
;
276
277
280
DtVrfObject
*
myRoute
;
281
284
bool
myRouteHasChanged
;
285
bool
myResetVertex
;
286
287
int
myPreviousVertex
;
288
289
bool
myAtDestination
;
290
bool
myNearDestination
;
291
bool
myPassedDestination
;
292
293
double
myDistanceSquared
;
294
DtVector
myLocalDestination
;
295
DtVector
myWorldDestination
;
296
double
myCurrentSpeed
;
297
mutable
bool
myDestinationVectorIsValid
;
298
mutable
DtVector
myDestinationVector
;
299
300
};
Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)