VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanMoveToController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Generated by VR-Forces Component Code Generator
3 ** WARNING: Changes to this file WILL BE LOST if file is regenerated.
4 *******************************************************************************/
5 
9 
12 
13 #pragma once
14 
17 
18 class DtCgf;
20 class DtSimMessage;
21 class DtHumanMoveToPSR;
23 class DtInputPortGroup;
25 class DtVectorOutputPort;
29 class DtGenericPsr;
30 class DtAnalogInputPort;
31 class DtVectorInputPort;
32 
44 {
45 private:
52 public:
54  DtHumanMoveToController(const DtString& name, DtVrfObject* owner, DtSimManager* simManager, DtComponentDescriptor* desc=0, DtReaderWriterRegistry *parentRegistry=0);
55 
57  virtual ~DtHumanMoveToController();
58 
60  virtual bool init();
61 
63  virtual const char* type() const;
64 
66  virtual void tick();
67 
72  static void moveToCallback(DtSimMessage * msg, void * usr);
73 
78  static void setLocationCallback(DtSimMessage* msg, void* usr);
79 
84  static void moveToLocationCallback(DtSimMessage * msg, void * usr);
85 
87  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner, DtSimManager* simManager, DtComponentDescriptor* desc=0, DtReaderWriterRegistry* parentRegistry=0);
88 
90  static void modifyVrfObjectCallback(DtSimMessage* msg, void* usr);
91 
92 protected:
93 
96  virtual void processMoveToTask(DtSimMessage * msg);
97 
98 
99  virtual void processMoveToLocationTask(DtSimMessage * msg);
100 
105  virtual void processDestinationChanged();
106 
110  virtual bool setupDestination();
111 
120  virtual void setupDestinationVector() const;
121 
123  virtual void invalidateDestinationVector() const;
124 
133  virtual bool atDestination();
134 
136  virtual void doMoving();
137 
139  virtual double findDesiredHeading();
140 
142  virtual double findDesiredSpeed();
143 
145  virtual void moveToDestination();
146 
149  virtual void stop(bool success);
150 
152  virtual void registerTaskMsgCallbacks();
153 
157  virtual void processModifyVrfObject(DtSimMessage* msg);
158 
161  virtual void processSetLocation(DtSimMessage* msg);
162 
164  virtual bool createPortGroups();
165 
167  virtual bool createPorts();
168 
174  virtual bool createPSR();
175 
176  virtual double distanceToDestination() const;
177 
179  virtual void clearTask();
180 
182  virtual bool destinationIsInsideObstruction(
183  const DtVector& localDestination) const;
184 
187  virtual bool decideToGiveUpTask() const;
188 
193  virtual double atDistance() const;
194 
196  virtual bool usingNavBot() const;
197 
199  virtual void useNavBotData();
200 
203  virtual unsigned maxNumFailedPathAttempts() const;
204 
207  virtual bool findAlternateDestination();
208 
210  virtual void setStuck(bool yesNo);
212  virtual double stuckTime();
213 
214  static void navAreaChangedCallback(void* usr);
215  virtual void processNavAreaChanged();
216 
220  DtVector localDestination() const;
221 
222  virtual void updateTaskVisualizations();
223 
226  virtual void suspendTask();
227 
229  virtual void preFirstTickInit();
230 
231  static void setAiEnabledCallback(DtSimMessage* msg, void* usrData);
232  virtual void processSetAiEnabled(DtSimMessage* msg);
233 
234  static void navigationInterfaceChanged(const DtVrfObject*, void* usr);
235  virtual void processNavigationInterfaceChanged(const DtVrfObject*);
236 
238  virtual void processEstimatedTotCalculation();
239 
240 protected:
241 
244 
252 
256 
259 
266 
273 
280 
288 
295 
297 
301 
304 
308 
311 
314 
319 
320  //Used to force the navigation interface to be ignored.
321  //This is useful when the nav interface has given us a partial
322  //path to the destination (for example, if we're in a nav area
323  //but our destination is outside the nav area).
324  //Once set, gets reset when any of the following happen:
325  //1) A new task is issued
326  //2) The destination location changes
327  //3) A set location occurs
328  //4) The entity moves to a new navArea.
330 
332 
334 
338  //DtGenericPsr* myHumanMovePsr;
339 
342 
344 
346  const double DtEstimatedTotCalcInterval = 5.0;
347 
356 };
357 
class DtHumanMoveToPSR:
Definition: humanMoveToPSR.h:27
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtAnalogInputPort * myEtaForLastVertexInputPort
Input Port Name: eta-for-last-vertex Input Port Description: Specifies the eta for the last vertex of...
Definition: humanMoveToController.h:294
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
bool myIgnoreNavData
Definition: humanMoveToController.h:329
virtual void suspendTask()
This method is called when the currently running task is being suspended.
DtHumanMovementControlOutputPortGroup * myHumanMovementControlOutputPortGroup
Output Group Name: movement-control .
Definition: humanMoveToController.h:258
DtHumanStateRepository * myHumanStateRepository
Definition: humanMoveToController.h:333
Description: This repository holds all information that is common to all the forms of humans within t...
Definition: humanStateRepository.h:32
This is the DtVrfObjectNavInterface subclass for objects which are actively querying the navigation s...
Definition: activeBotNavInterface.h:26
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
double myEstimatedTotLastCalcTime
used for tot calculation intervals
Definition: humanMoveToController.h:353
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
DtVector myIntermediateLocalDestination
Definition: humanMoveToController.h:307
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
const DtVrfObject * myControlPoint
This is looked up once per tick - assumed unchanging while we have control.
Definition: humanMoveToController.h:300
Definition: readerWriterRegistry.h:39
DtVector myLocalDestination
Definition: humanMoveToController.h:302
virtual const char * type() const =0
Returns a string identifies the class type of component.
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
bool myDestinationVectorIsValid
Definition: humanMoveToController.h:310
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:485
DtBooleanOutputPort * myUseCollisionAvoidancePort
Output Port Name: use-collision-avoidance Output Port Description: Indicates whether or not this cont...
Definition: humanMoveToController.h:279
DtHumanMoveToPSR * myProcessState
Container for state data associated with this component.
Definition: humanMoveToController.h:337
DtVectorInputPort * myLastVertexLocationInputPort
Input Port Name: last-vertex-location Input Port Description: Specifies the last vertex location of t...
Definition: humanMoveToController.h:287
void registerDtHumanMoveToController(DtCgf *cgf)
Registers component and associated classes with the factories. Call after DtVrfApp::init() ...
bool myEstimatedTotCalcEnabled
enabled flag for the tot calculations
Definition: humanMoveToController.h:349
DtInputPortGroup * myCollisionAvoidancePortGroup
Input Port Group Name: collision-avoidance-control Input Port Group Description:
Definition: humanMoveToController.h:255
DtVector myIntermediateWorldDestination
Definition: humanMoveToController.h:306
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
DtActiveBotNavInterface * myNavInterface
Definition: humanMoveToController.h:341
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: humanMoveToController.h:265
DtCollisionInputPort * myCollisionAvoidancePort
Input Port Name: potential-collision-info Input Port Description: information about an impending pote...
Definition: humanMoveToController.h:251
double myDistanceSquared
Definition: humanMoveToController.h:313
DtVector myWorldDestination
Definition: humanMoveToController.h:303
DtHumanMoveToControllerDescriptor; descriptor for the DtHumanMoveToControllerDescriptor component...
Definition: humanMoveToControllerDescriptor.h:23
virtual bool createPorts()
Called by init.
bool myOverrideAtDistance
Definition: humanMoveToController.h:315
virtual bool decideToGiveUpTask() const
This function is used to determine if the controller should give up trying to execute the current tas...
double myEstimatedTotValue
the tot value
Definition: humanMoveToController.h:351
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtBooleanOutputPort * myIsMovingPort
Output Port Name: is-moving Output Port Description: Indicates the entity is being actively moved by ...
Definition: humanMoveToController.h:272
DtHumanMoveToControllerDescriptor * myHumanMoveToControllerDescriptor
Definition: humanMoveToController.h:340
bool myAtDestination
Definition: humanMoveToController.h:312
DtInputPortGroup is a data port group of a data consumer.
Definition: inputPortGroup.h:32
Instances of DtCollisionInputPort are input ports through which data consumers can receive informatio...
Definition: collisionIOPort.h:29
DtHumanMoveAlongController is a controller that models movement to a <location> or <waypoint> for ind...
Definition: humanMoveToController.h:43
Contains class declarations for DtAnalogInputPort, DtAnalogOutputPort, and DtAnalogPortData.
Definition: analogIOPort.h:25
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
A DtVrfProcessStateRepository subclass that keeps an arbitrary key/value pair set of data...
Definition: genericPsr.h:17
unsigned myNumFailedPathAttempts
Definition: humanMoveToController.h:331
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
These functions handle the standard sets that can affect the time estimates.
An output port group that contains the ports necessary to control the movement of a human using the D...
Definition: humanMovementControlOutputPortGroup.h:22
bool myHasIntermediateDestination
Definition: humanMoveToController.h:305
bool myAIEnabled
Definition: humanMoveToController.h:343
An instance of DtCgf is an object representing a CGF (Computer Generated Forces). ...
Definition: cgf.h:115
DtVector myEstimatedTotTextPos
tot text position
Definition: humanMoveToController.h:355
DtVector myDestinationVector
Definition: humanMoveToController.h:309
double myOverrideAtDistanceValue
Definition: humanMoveToController.h:316
bool myOverrideSpeed
Definition: humanMoveToController.h:317
double myOverrideSpeedValue
Definition: humanMoveToController.h:318

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)