VR-Forces 4.3 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
class
DtAggregatedMoveToDescriptor
;
19
class
DtBooleanOutputPort
;
20
24
#include "
vrfmodel/vrfmodelDefines.h
"
25
class
DT_DLL_vrfmodel
DtAggregatedMoveAlongController
:
public
DtSingleTaskControllerComponent
26
{
27
private
:
29
DtAggregatedMoveAlongController
();
31
DtAggregatedMoveAlongController
(
const
DtAggregatedMoveAlongController
& orig);
33
DtAggregatedMoveAlongController
&
operator=
(
34
const
DtAggregatedMoveAlongController
& orig);
35
public
:
37
DtAggregatedMoveAlongController
(
const
DtString
& name,
DtVrfObject
* owner,
38
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
39
DtReaderWriterRegistry
*parentRegistry=0);
40
42
virtual
~
DtAggregatedMoveAlongController
();
43
45
virtual
bool
init
();
46
48
virtual
DtString
type
()
const
;
49
53
virtual
void
preFirstTickInit
();
54
56
virtual
void
tick
();
57
61
static
void
routeChangedCallback(
DtVrfObject
* obj,
void
* usr);
62
virtual
void
processRouteChanged(
DtVrfObject
* obj);
63
65
virtual
void
registerTaskMsgCallbacks
();
66
67
static
void
moveAlongCallback(
DtSimMessage
* msg,
void
* usr,
DtSimTaskStatePtr
taskStatePtr);
68
static
void
moveAlongRetrogradeCallback(
DtSimMessage
* msg,
void
* usr,
DtSimTaskStatePtr
taskStatePtr);
69
77
virtual
bool
setupRoute();
78
85
virtual
bool
setupDestination();
86
88
virtual
double
findDesiredSpeed();
89
95
virtual
void
stop();
96
98
static
void
objectAddedCb(
DtVrfObject
* vrfObject,
void
* usr);
99
101
static
DtSimComponent
* creator(
const
DtString
& name,
DtVrfObject
* owner,
102
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
103
DtReaderWriterRegistry
* parentRegistry=0);
104
106
virtual
bool
createPorts
();
107
109
virtual
bool
createPortGroups
();
110
116
virtual
bool
createPSR();
117
120
virtual
void
doMoving();
121
124
virtual
double
findDesiredHeading(
DtVector
& dest);
125
127
//virtual bool destinationIsInsideObstruction(
129
132
//virtual bool decideToGiveUpTask() const;
133
134
protected
:
135
virtual
void
processMoveAlong(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
136
virtual
void
processMoveAlongRetrograde(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
137
141
virtual
void
buildLocalRoute();
142
145
virtual
void
emptyVertexList();
146
150
virtual
void
processObjectAdded(
DtVrfObject
* vrfObject);
151
154
virtual
void
clearTask
();
155
157
virtual
void
moveToDestination();
158
160
virtual
void
invalidateDestinationVector()
const
;
161
virtual
double
distanceToDestination()
const
;
162
171
virtual
bool
atDestination();
172
182
virtual
bool
passedDestination();
183
192
virtual
bool
getDestination(
DtVector
& destination);
193
198
virtual
const
DtVector
& destinationVector()
const
;
199
208
virtual
void
setupDestinationVector()
const
;
209
214
virtual
double
atDistance()
const
;
215
221
virtual
bool
stayOnRoute()
const
;
222
227
virtual
double
minCorrectionDistance()
const
;
228
236
virtual
double
maxCorrectionDistance()
const
;
237
241
virtual
double
maxCorrectionAngle()
const
;
242
251
virtual
void
computePointToSegmentGeometry(
252
const
DtVector
& localPoint,
253
const
DtVector
& localLinePt1,
const
DtVector
& localLinePt2,
254
const
Coordinate_System& coordinateSystemRef,
255
double
& r,
bool
&leftSide,
double
&distanceToSegment);
256
260
virtual
bool
getCurrentRouteSegment(
DtVector
& routeSegmentStart,
261
DtVector
& routeSegmentEnd)
const
;
262
263
DtSimTaskStatePtr
currentTaskState
()
const
;
264
265
protected
:
266
269
DtOutputPortGroup
*
myMovementControlPortGroup
;
274
DtAnalogOutputPort
*
mySpeedPort
;
275
280
DtAnalogOutputPort
*
myMovementDirectionPort
;
281
287
DtVectorOutputPort
*
myDestinationOutputPort
;
288
289
DtVrfAggregateStateRepository
*
myTrueAggregateRepository
;
290
293
DtAggregatedMoveAlongPSR
*
myProcessState
;
294
295
298
DtVrfObject
*
myRoute
;
299
302
bool
myRouteHasChanged
;
303
bool
myResetVertex
;
304
305
int
myPreviousVertex
;
306
307
bool
myAtDestination
;
308
bool
myPassedDestination
;
309
310
double
myDistanceSquared
;
311
DtVector
myLocalDestination
;
312
DtVector
myWorldDestination
;
313
double
myCurrentSpeed
;
314
mutable
bool
myDestinationVectorIsValid
;
315
mutable
DtVector
myDestinationVector
;
316
317
DtAggregatedMoveToDescriptor
*
myAggregatedMoveToDescriptor
;
318
DtBooleanOutputPort
*
myRetrogradeOutputPort
;
319
};
Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)