VR-Forces 4.2 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) 2013 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
#include "
vrfmodel/bindableLuaComponent.h
"
17
18
class
DtCgf
;
19
class
DtHumanStateRepository
;
20
class
DtSimMessage
;
21
class
DtHumanMoveAlongPSR
;
22
class
DtHumanMovementControlOutputPortGroup
;
23
class
DtVectorOutputPort
;
24
class
DtLocalVectorIterator
;
25
class
DtCollisionInputPort
;
26
class
DtInputPortGroup
;
27
class
DtHumanMoveAlongControllerDescriptor
;
28
38
class
DT_DLL_vrfmodel
DtHumanMoveAlongController
:
public
DtSingleTaskControllerComponent
39
{
40
private
:
42
DtHumanMoveAlongController
();
44
DtHumanMoveAlongController
(
const
DtHumanMoveAlongController
& orig);
46
DtHumanMoveAlongController
&
operator=
(
47
const
DtHumanMoveAlongController
& orig);
48
public
:
51
DtHumanMoveAlongController
(
const
DtString
& name,
DtVrfObject
* owner,
52
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
53
DtReaderWriterRegistry
*parentRegistry=0);
54
56
virtual
~
DtHumanMoveAlongController
();
57
59
virtual
bool
init
();
60
63
virtual
DtString
type
()
const
;
64
69
virtual
void
preFirstTickInit
();
70
78
virtual
void
tick
();
79
80
static
void
moveAlongCallback(
DtSimMessage
* msg,
void
* usr,
DtSimTaskStatePtr
taskStatePtr);
81
82
virtual
DtSimTaskStatePtr
currentTaskState
()
const
;
83
87
static
void
routeChangedCallback(
DtVrfObject
* obj,
void
* usr);
88
virtual
void
processRouteChanged(
DtVrfObject
* obj);
89
91
virtual
void
registerTaskMsgCallbacks
();
92
100
virtual
bool
setupRoute();
101
108
virtual
bool
setupDestination();
109
111
virtual
double
findDesiredSpeed();
112
118
virtual
void
stop();
119
121
static
void
objectAddedCb(
DtVrfObject
* vrfObject,
void
* usr);
122
124
static
DtSimComponent
* creator(
const
DtString
& name,
DtVrfObject
* owner,
125
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
126
DtReaderWriterRegistry
* parentRegistry=0);
127
129
virtual
bool
createPorts
();
130
132
virtual
bool
createPortGroups
();
133
139
virtual
bool
createPSR();
140
143
virtual
void
doMoving();
144
146
virtual
double
findDesiredHeading();
147
149
virtual
bool
destinationIsInsideObstruction(
150
const
DtVector
& localDestination)
const
;
151
154
virtual
bool
decideToGiveUpTask
()
const
;
155
156
protected
:
157
virtual
void
processMoveAlong(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
158
162
virtual
void
buildLocalRoute();
163
166
virtual
void
emptyVertexList();
167
169
static
DtReaderWriter
* provideNextRoutePointIndex(
void
* c);
170
172
virtual
DtHumanMoveAlongPSR
*
getPSR
(){
return
myProcessState;}
173
177
virtual
void
processObjectAdded(
DtVrfObject
* vrfObject);
178
181
virtual
void
clearTask
();
182
184
virtual
void
moveToDestination();
185
187
virtual
void
invalidateDestinationVector()
const
;
188
virtual
double
distanceToDestination()
const
;
189
198
virtual
bool
atDestination();
199
209
virtual
bool
passedDestination();
210
219
virtual
bool
getDestination(
DtVector
& destination);
220
225
virtual
const
DtVector
& destinationVector()
const
;
226
235
virtual
void
setupDestinationVector()
const
;
236
241
virtual
double
atDistance()
const
;
242
248
virtual
bool
stayOnRoute()
const
;
249
255
virtual
double
minCorrectionDistance()
const
;
256
264
virtual
double
maxCorrectionDistance()
const
;
265
269
virtual
double
maxCorrectionAngle()
const
;
270
274
virtual
bool
getCurrentRouteSegment(
DtVector
& routeSegmentStart,
275
DtVector
& routeSegmentEnd)
const
;
276
277
protected
:
278
281
287
DtCollisionInputPort
*
myCollisionAvoidancePort
;
288
291
DtInputPortGroup
*
myCollisionAvoidancePortGroup
;
292
294
DtHumanMovementControlOutputPortGroup
*
myHumanMovementControlOutputPortGroup
;
295
301
DtVectorOutputPort
*
myDestinationOutputPort
;
302
304
305
DtHumanStateRepository
*
myHumanStateRepository
;
306
309
DtHumanMoveAlongPSR
*
myProcessState
;
310
311
DtHumanMoveAlongControllerDescriptor
*
myHumanMoveAlongControllerDescriptor
;
312
315
DtVrfObject
*
myRoute
;
316
319
bool
myRouteHasChanged
;
320
bool
myResetVertex
;
321
322
int
myPreviousVertex
;
323
324
bool
myAtDestination
;
325
bool
myNearDestination
;
326
bool
myPassedDestination
;
327
328
double
myDistanceSquared
;
329
DtVector
myLocalDestination
;
330
DtVector
myWorldDestination
;
331
double
myCurrentSpeed
;
332
mutable
bool
myDestinationVectorIsValid
;
333
mutable
DtVector
myDestinationVector
;
334
};
335
338
void
registerDtHumanMoveAlongController
(
DtCgf
* cgf);
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
)