VR-Forces 4.7 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
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
const
char
*
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
121
virtual
void
doMoving();
122
128
virtual
double
findDesiredHeading(
DtVector
& dest);
129
131
//virtual bool destinationIsInsideObstruction(
133
136
//virtual bool decideToGiveUpTask() const;
137
138
protected
:
139
virtual
void
processMoveAlong(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
140
virtual
void
processMoveAlongRetrograde(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
141
145
//virtual void buildLocalRoute();
146
149
virtual
void
emptyVertexList();
150
154
virtual
void
processObjectAdded(
DtVrfObject
* vrfObject);
155
158
virtual
void
clearTask
();
159
161
virtual
void
moveToDestination();
162
166
virtual
double
distanceToDestinationSquared()
const
;
167
176
virtual
bool
atDestination();
177
184
virtual
bool
passedDestination();
185
194
virtual
bool
getDestination(
DtVector
& destination);
195
197
virtual
DtVector
destinationVector()
const
;
198
203
virtual
double
atDistance()
const
;
204
210
virtual
bool
stayOnRoute()
const
;
211
216
virtual
double
minCorrectionDistance()
const
;
217
225
virtual
double
maxCorrectionDistance()
const
;
226
230
virtual
double
correctionAngle(
const
double
distanceFromLine)
const
;
231
240
virtual
void
computePointToSegmentGeometry(
241
const
DtVector
& localPoint,
242
const
DtVector
& localLinePt1,
const
DtVector
& localLinePt2,
243
const
Coordinate_System
& coordinateSystemRef,
244
double
& r,
bool
&leftSide,
double
&distanceToSegment);
245
249
virtual
bool
getCurrentRouteSegment(
DtVector
& routeSegmentStart,
250
DtVector
& routeSegmentEnd)
const
;
251
252
DtSimTaskStatePtr
currentTaskState
()
const
;
253
255
virtual
void
calculateRadius();
256
257
protected
:
258
259
const
Coordinate_System
* localCS()
const
;
260
263
DtOutputPortGroup
*
myMovementControlPortGroup
;
268
DtAnalogOutputPort
*
mySpeedPort
;
269
274
DtAnalogOutputPort
*
myMovementDirectionPort
;
275
281
DtVectorOutputPort
*
myDestinationOutputPort
;
282
283
DtVrfAggregateStateRepository
*
myTrueAggregateRepository
;
284
287
DtAggregatedMoveAlongPSR
*
myProcessState
;
288
291
bool
myRouteHasChanged
;
292
bool
myResetVertex
;
293
294
DtVector
myLocalDestination
;
295
DtVector
myWorldDestination
;
296
double
myUnitRadius
;
297
298
DtAggregatedMoveToDescriptor
*
myAggregatedMoveToDescriptor
;
299
DtBooleanOutputPort
*
myRetrogradeOutputPort
;
300
};
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)