VR-Forces 4.1.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrfmodel
humanMoveAlongController.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
8
11
12
#pragma once
13
14
#include "
vrfobjcore/singleTaskControllerComponent.h
"
15
#include "
vrfmodel/vrfmodelDefines.h
"
16
17
class
DtCgf
;
18
class
DtHumanStateRepository
;
19
class
DtSimMessage
;
20
class
DtHumanMoveAlongPSR
;
21
class
DtHumanMovementControlOutputPortGroup
;
22
class
DtVectorOutputPort
;
23
class
DtLocalVectorIterator
;
24
class
DtCollisionInputPort
;
25
class
DtInputPortGroup
;
26
class
DtHumanMoveAlongControllerDescriptor
;
27
37
class
DT_DLL_vrfmodel
DtHumanMoveAlongController
:
public
DtSingleTaskControllerComponent
38
{
39
private
:
41
DtHumanMoveAlongController
();
43
DtHumanMoveAlongController
(
const
DtHumanMoveAlongController
& orig);
45
DtHumanMoveAlongController
&
operator=
(
46
const
DtHumanMoveAlongController
& orig);
47
public
:
50
DtHumanMoveAlongController
(
const
DtString
& name,
DtVrfObject
* owner,
51
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
52
DtReaderWriterRegistry
*parentRegistry=0);
53
55
virtual
~
DtHumanMoveAlongController
();
56
58
virtual
bool
init
();
59
62
virtual
DtString
type
()
const
;
63
68
virtual
void
preFirstTickInit
();
69
77
virtual
void
tick
();
78
82
static
void
moveAlongCallback(
DtSimMessage
* msg,
void
* usr);
83
86
virtual
void
processMoveAlongTask(
DtSimMessage
* msg);
87
91
static
void
routeChangedCallback(
DtVrfObject
* obj,
void
* usr);
92
virtual
void
processRouteChanged(
DtVrfObject
* obj);
93
95
virtual
void
registerTaskMsgCallbacks
();
96
104
virtual
bool
setupRoute();
105
112
virtual
bool
setupDestination();
113
115
virtual
double
findDesiredSpeed();
116
122
virtual
void
stop();
123
125
static
void
objectAddedCb(
DtVrfObject
* vrfObject,
void
* usr);
126
128
static
DtSimComponent
* creator(
const
DtString
& name,
DtVrfObject
* owner,
129
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
130
DtReaderWriterRegistry
* parentRegistry=0);
131
133
virtual
bool
createPorts
();
134
136
virtual
bool
createPortGroups
();
137
143
virtual
bool
createPSR();
144
147
virtual
void
doMoving();
148
150
virtual
double
findDesiredHeading();
151
153
virtual
bool
destinationIsInsideObstruction(
154
const
DtVector
& localDestination)
const
;
155
158
virtual
bool
decideToGiveUpTask
()
const
;
159
160
protected
:
161
165
virtual
void
buildLocalRoute();
166
169
virtual
void
emptyVertexList();
170
174
virtual
void
processObjectAdded(
DtVrfObject
* vrfObject);
175
178
virtual
void
clearTask
();
179
181
virtual
void
moveToDestination();
182
184
virtual
void
invalidateDestinationVector()
const
;
185
virtual
double
distanceToDestination()
const
;
186
195
virtual
bool
atDestination();
196
206
virtual
bool
passedDestination();
207
216
virtual
bool
getDestination(
DtVector
& destination);
217
222
virtual
const
DtVector
& destinationVector()
const
;
223
232
virtual
void
setupDestinationVector()
const
;
233
238
virtual
double
atDistance()
const
;
239
245
virtual
bool
stayOnRoute()
const
;
246
252
virtual
double
minCorrectionDistance()
const
;
253
261
virtual
double
maxCorrectionDistance()
const
;
262
266
virtual
double
maxCorrectionAngle()
const
;
267
271
virtual
bool
getCurrentRouteSegment(
DtVector
& routeSegmentStart,
272
DtVector
& routeSegmentEnd)
const
;
273
274
protected
:
275
278
284
DtCollisionInputPort
*
myCollisionAvoidancePort
;
285
288
DtInputPortGroup
*
myCollisionAvoidancePortGroup
;
289
291
DtHumanMovementControlOutputPortGroup
*
myHumanMovementControlOutputPortGroup
;
292
298
DtVectorOutputPort
*
myDestinationOutputPort
;
299
301
302
DtHumanStateRepository
*
myHumanStateRepository
;
303
306
DtHumanMoveAlongPSR
*
myProcessState
;
307
308
DtHumanMoveAlongControllerDescriptor
*
myHumanMoveAlongControllerDescriptor
;
309
312
DtVrfObject
*
myRoute
;
313
316
bool
myRouteHasChanged
;
317
bool
myResetVertex
;
318
319
int
myPreviousVertex
;
320
321
bool
myAtDestination
;
322
bool
myNearDestination
;
323
bool
myPassedDestination
;
324
325
double
myDistanceSquared
;
326
DtVector
myLocalDestination
;
327
DtVector
myWorldDestination
;
328
double
myCurrentSpeed
;
329
mutable
bool
myDestinationVectorIsValid
;
330
mutable
DtVector
myDestinationVector
;
331
};
332
335
void
registerDtHumanMoveAlongController
(
DtCgf
* cgf);
Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)