VR-Forces 4.6 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
humanFleeController.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2015 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
9
12
13
#pragma once
14
15
#include "
vrfmodel/vrfmodelDefines.h
"
16
#include "
vrfobjcore/singleTaskControllerComponent.h
"
17
#include <
vrfNavigation/navArea.h
>
18
19
class
DtHumanFleeControllerDescriptor
;
20
class
DtActiveBotNavInterface
;
21
class
DtScriptedTaskTask
;
22
class
DtHumanStateRepository
;
23
class
DtHumanFleePSR
;
24
class
DtHumanMovementControlOutputPortGroup
;
25
class
DtVectorOutputPort
;
26
class
DtBooleanOutputPort
;
27
32
class
DT_DLL_vrfmodel
DtHumanFleeController
:
public
DtSingleTaskControllerComponent
33
{
34
private
:
36
DtHumanFleeController
();
38
DtHumanFleeController
(
const
DtHumanFleeController
& orig);
40
DtHumanFleeController
&
operator=
(
const
DtHumanFleeController
& orig);
41
public
:
43
DtHumanFleeController
(
const
DtString
& name,
DtVrfObject
* owner,
44
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
DtReaderWriterRegistry
*parentRegistry=0);
45
47
virtual
~
DtHumanFleeController
();
48
50
virtual
bool
init
();
51
53
virtual
const
char
*
type
()
const
;
54
56
virtual
void
tick
();
57
62
static
void
fleeCallback(
DtSimMessage
* msg,
void
* usr);
63
65
static
DtSimComponent
* creator(
const
DtString
& name,
DtVrfObject
* owner,
DtSimManager
* simManager,
66
DtComponentDescriptor
* desc=0,
DtReaderWriterRegistry
* parentRegistry=0);
67
68
protected
:
69
71
virtual
bool
createPortGroups
();
72
74
virtual
bool
createPorts
();
75
76
virtual
bool
usingNavBot()
const
;
77
78
virtual
void
processFleeTask(
DtSimMessage
* msg);
79
81
virtual
void
registerTaskMsgCallbacks
();
82
83
static
void
navAreaChangedCallback(
void
* usr);
84
virtual
void
processNavAreaChanged();
85
88
virtual
std::list<DtVector> getFleeFromPoints(
DtScriptedTaskTask
*);
89
91
virtual
double
getFleeRadius(
DtScriptedTaskTask
*);
92
94
virtual
bool
atDestination();
95
97
virtual
void
doMoving();
98
100
virtual
double
findDesiredHeading();
101
104
virtual
void
stop(
bool
success);
105
106
virtual
void
clearTask
();
107
111
virtual
DtVector
findFleeToPoint(
double
radius,
const
std::list<DtVector>& localFrom);
112
115
virtual
double
fleePointMaxCost(
const
std::list<DtVector>& fleeFromPtList,
const
DtVector
& fleeToPt,
116
double
maxFleeDist,
bool
collision);
117
120
virtual
double
fleePointCost(
const
DtVector
& fleeFromPt,
const
DtVector
& fleeToPt,
121
double
maxFleeDist,
bool
collision);
122
125
virtual
bool
pointsMoved(
const
std::list<DtVector>& pts1,
const
std::list<DtVector>& pts2,
double
threshhold);
126
128
static
void
objectAboutToBeRemoved(
DtVrfObject
* msg,
void
* usr);
129
virtual
void
processObjectAboutToBeRemoved(
DtVrfObject
* msg);
130
132
virtual
void
processFleeTask(
DtScriptedTaskTask
*);
133
134
virtual
void
showFleePoint();
135
136
virtual
void
preFirstTickInit
();
137
virtual
bool
createPSR();
138
139
virtual
bool
entityInDestination(
const
DtVector
& dest);
140
141
virtual
void
updateTaskVisualizations
();
142
143
static
void
navigationInterfaceChanged(
DtVrfObject
*,
void
* usr);
144
virtual
void
processNavigationInterfaceChanged(
DtVrfObject
*);
145
146
protected
:
147
DtHumanFleeControllerDescriptor
*
myHumanFleeControllerDescriptor
;
148
DtActiveBotNavInterface
*
myNavInterface
;
149
bool
myIgnoreNavData
;
150
const
DtHumanStateRepository
*
myHumanSR
;
151
152
DtHumanFleePSR
*
myProcessState
;
153
154
bool
mySetupFromTaskWhenCan
;
157
std::list<DtVector>
myCachedFleeFromPoints
;
158
159
typedef
std::pair<DtVector, double>
PointAndCost
;
160
std::vector<PointAndCost>
myCandidateFleeToPoints
;
161
162
165
167
DtHumanMovementControlOutputPortGroup
*
myHumanMovementControlOutputPortGroup
;
168
174
DtVectorOutputPort
*
myDestinationOutputPort
;
175
181
DtBooleanOutputPort
*
myIsMovingPort
;
182
188
DtBooleanOutputPort
*
myUseCollisionAvoidancePort
;
189
191
192
bool
myWasTasked
;
193
};
Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)