VR-Forces 4.1 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
moveAlongCallback(
DtSimMessage
* msg,
void
* usr,
DtSimTaskStatePtr
taskState);
60
63
virtual
void
processMoveAlongTask(
DtSimMessage
* msg,
DtSimTaskStatePtr
taskState);
64
68
static
void
routeChangedCallback(
DtVrfObject
* obj,
void
* usr);
69
virtual
void
processRouteChanged(
DtVrfObject
* obj);
70
72
virtual
void
registerTaskMsgCallbacks
();
73
81
virtual
bool
setupRoute();
82
89
virtual
bool
setupDestination();
90
92
virtual
double
findDesiredSpeed();
93
99
virtual
void
stop();
100
102
static
void
objectAddedCb(
DtVrfObject
* vrfObject,
void
* usr);
103
105
static
DtSimComponent
* creator(
const
DtString
& name,
DtVrfObject
* owner,
106
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
107
DtReaderWriterRegistry
* parentRegistry=0);
108
110
virtual
bool
createPorts
();
111
113
virtual
bool
createPortGroups
();
114
120
virtual
bool
createPSR();
121
124
virtual
void
doMoving();
125
127
virtual
double
findDesiredHeading();
128
130
//virtual bool destinationIsInsideObstruction(
132
135
//virtual bool decideToGiveUpTask() const;
136
137
protected
:
138
142
virtual
void
buildLocalRoute();
143
146
virtual
void
emptyVertexList();
147
151
virtual
void
processObjectAdded(
DtVrfObject
* vrfObject);
152
155
virtual
void
clearTask
();
156
158
virtual
void
moveToDestination();
159
161
virtual
void
invalidateDestinationVector()
const
;
162
virtual
double
distanceToDestination()
const
;
163
172
virtual
bool
atDestination();
173
183
virtual
bool
passedDestination();
184
193
virtual
bool
getDestination(
DtVector
& destination);
194
199
virtual
const
DtVector
& destinationVector()
const
;
200
209
virtual
void
setupDestinationVector()
const
;
210
215
virtual
double
atDistance()
const
;
216
222
virtual
bool
stayOnRoute()
const
;
223
229
virtual
double
minCorrectionDistance()
const
;
230
238
virtual
double
maxCorrectionDistance()
const
;
239
243
virtual
double
maxCorrectionAngle()
const
;
244
248
virtual
bool
getCurrentRouteSegment(
DtVector
& routeSegmentStart,
249
DtVector
& routeSegmentEnd)
const
;
250
251
DtSimTaskStatePtr
currentTaskState
()
const
;
252
253
protected
:
254
257
DtOutputPortGroup
*
myMovementControlPortGroup
;
262
DtAnalogOutputPort
*
mySpeedPort
;
263
268
DtAnalogOutputPort
*
myMovementDirectionPort
;
269
275
DtVectorOutputPort
*
myDestinationOutputPort
;
276
277
DtVrfAggregateStateRepository
*
myTrueAggregateRepository
;
278
281
DtAggregatedMoveAlongPSR
*
myProcessState
;
282
283
286
DtVrfObject
*
myRoute
;
287
290
bool
myRouteHasChanged
;
291
bool
myResetVertex
;
292
293
int
myPreviousVertex
;
294
295
bool
myAtDestination
;
296
bool
myNearDestination
;
297
bool
myPassedDestination
;
298
299
double
myDistanceSquared
;
300
DtVector
myLocalDestination
;
301
DtVector
myWorldDestination
;
302
double
myCurrentSpeed
;
303
mutable
bool
myDestinationVectorIsValid
;
304
mutable
DtVector
myDestinationVector
;
305
306
};
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)