VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanMoveAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
17 
18 class DtCgf;
20 class DtSimMessage;
23 class DtVectorOutputPort;
24 class DtAnalogOutputPort;
25 
38 {
39 private:
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 const char* type() const;
63 
68  virtual void preFirstTickInit();
69 
77  virtual void tick();
78 
79  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
80 
81  virtual DtSimTaskStatePtr currentTaskState() const;
82 
86  static void routeChangedCallback(const DtVrfObject* obj, void * usr);
87  virtual void processRouteChanged(const DtVrfObject* obj);
88 
90  virtual void registerTaskMsgCallbacks();
91 
99  virtual bool setupRoute(bool routeHasChanged, bool resetVertex);
100 
107  virtual bool setupDestination();
108 
114  virtual void stop();
115 
117  static void objectAddedCb(const DtVrfObject* vrfObject, void * usr);
118 
120  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner,
121  DtSimManager* simManager, DtComponentDescriptor* desc=0,
122  DtReaderWriterRegistry* parentRegistry=0);
123 
129  virtual bool createPSR();
130 
131 protected:
132  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
133 
137  virtual void buildLocalRoute();
138 
141  virtual void emptyVertexList();
142 
144  static DtReaderWriter* provideNextRoutePointIndex(void* c);
145 
147  virtual DtHumanMoveAlongPSR* getPSR(){return myProcessState;}
148 
152  virtual void processObjectAdded(const DtVrfObject* vrfObject);
153 
155  virtual void setDestination(const DtVector& localLocation);
156  virtual void createMoveToPoint(const DtVector& localLocation);
157 
159  virtual void sendMoveToSubtask();
160 
163  virtual void clearTask();
164 
168  virtual bool getCurrentRouteSegment(DtVector& routeSegmentStart,
169  DtVector& routeSegmentEnd) const;
170 
172  virtual void cleanupMoveToPoint();
173 
174  static void taskCompleteReportCallback(DtSimMessage* msg, void* usr);
175  virtual void processTaskCompleteReport(DtSimMessage* msg);
176 
177  virtual bool passedDestination();
178  virtual void setupDestinationVector();
179 
180  virtual bool atDestination() const;
181  virtual double distanceToDestination() const;
182 
183  virtual double atDistance() const;
184 
185  virtual bool createPorts();
186 
187  virtual void processEstimatedTotCalculation();
188 
189 protected:
190 
192 
196 
198 
202 
205 
207 
210 
217 
224 
231 
233  const double DtEstimatedTotCalcInterval = 5.0;
234 
241 
246 };
247 
bool myEstimatedTotCalcEnabled
enabled flag for the tot calculations
Definition: humanMoveAlongController.h:236
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
double myRouteWaitTimeout
Definition: humanMoveAlongController.h:245
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
virtual DtHumanMoveAlongPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: humanMoveAlongController.h:147
Description: This repository holds all information that is common to all the forms of humans within t...
Definition: humanStateRepository.h:32
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
Definition: readerWriter.h:85
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
bool myOverrideSpeed
Definition: humanMoveAlongController.h:208
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtVector myWorldDestination
Definition: humanMoveAlongController.h:203
double myOverrideSpeedValue
Definition: humanMoveAlongController.h:209
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtHumanMoveAlongControllerDescriptor; descriptor for the DtHumanMoveAlongController component...
Definition: humanMoveAlongControllerDescriptor.h:18
bool myWaitingRoute
Definition: humanMoveAlongController.h:243
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
void registerDtHumanMoveAlongController(DtCgf *cgf)
Registers component and associated classes with the factories.
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
double myMissingTimeStart
Definition: humanMoveAlongController.h:244
File: simMsg.h.
Definition: simMessage.h:35
DtVector myLocalDestination
Definition: humanMoveAlongController.h:204
virtual void tick()
This gives the thread of control to the component.
DtHumanStateRepository * myHumanStateRepository
Definition: humanMoveAlongController.h:191
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: humanMoveAlongController.h:230
virtual DtSimTaskStatePtr currentTaskState() const
double myEstimatedTotValue
the tot value
Definition: humanMoveAlongController.h:238
virtual bool createPorts()
Called by init.
DtAnalogOutputPort * myEtaForLastVertexOutputPort
Output Port Name: eta-for-last-vertex Output Port Description: Specifies the eta for the last vertex ...
Definition: humanMoveAlongController.h:223
double myEstimatedTotLastCalcTime
used for tot calculation intervals
Definition: humanMoveAlongController.h:240
DtHumanMoveAlongController is a controller that models movement along a route for an individual human...
Definition: humanMoveAlongController.h:37
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
class DtHumanMoveAlongPSR:
Definition: humanMoveAlongPSR.h:26
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
DtVectorOutputPort * myLastVertexLocationOutputPort
Output Port Name: last-vertex-location Output Port Description: Specifies the last vertex location of...
Definition: humanMoveAlongController.h:216
const DtVrfObject * myRoute
This is looked up once per tick - assumed unchanging while we have control.
Definition: humanMoveAlongController.h:201
An instance of DtCgf is an object representing a CGF (Computer Generated Forces). ...
Definition: cgf.h:115
bool myWarnedOnce
Definition: humanMoveAlongController.h:242
DtHumanMoveAlongControllerDescriptor * myHumanMoveAlongControllerDescriptor
Definition: humanMoveAlongController.h:197
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19
DtHumanMoveAlongPSR * myProcessState
Container for state data associated with this component.
Definition: humanMoveAlongController.h:195
DtVector myDestinationVector
Definition: humanMoveAlongController.h:206

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)