VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aggregatedMoveToController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
11 
12 #pragma once
13 
16 
17 class DtCgf;
19 class DtSimMessage;
21 class DtOutputPortGroup;
23 class DtVectorOutputPort;
25 class DtAnalogOutputPort;
26 class DtSetDataRequest;
27 class DtSetDataManager;
28 
43 {
44 private:
51 public:
53  DtAggregatedMoveToController(const DtString& name, DtVrfObject* owner, DtSimManager* simManager, DtComponentDescriptor* desc=0, DtReaderWriterRegistry *parentRegistry=0);
54 
57 
59  virtual bool init();
60 
62  virtual const char* type() const;
63 
65  virtual void tick();
66 
71  static void moveToCallback(DtSimMessage * msg, void * usr);
72  static void moveToRetrogradeCallback(DtSimMessage * msg, void * usr);
73 
78  static void setLocationCallback(DtSimMessage* msg, void* usr);
79 
84  static void moveToLocationCallback(DtSimMessage * msg, void * usr);
85  static void moveToLocationRetrogradeCallback(DtSimMessage * msg, void * usr);
86 
91  static void moveIntoFormationCallback(DtSimMessage * msg, void * usr);
92 
97  static void turnToHeadingCallback(DtSimMessage* msg, void* usrData);
98 
100  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner, DtSimManager* simManager, DtComponentDescriptor* desc=0, DtReaderWriterRegistry* parentRegistry=0);
101 
103  static void modifyVrfObjectCallback(DtSimMessage* msg, void* usr);
104 
105 protected:
106 
109  virtual void processMoveToTask(DtSimMessage * msg);
110  virtual void processMoveToLocationTask(DtSimMessage * msg);
111  virtual void processMoveToRetrogradeTask(DtSimMessage * msg);
112  virtual void processMoveToLocationRetrogradeTask(DtSimMessage * msg);
113  virtual void preFirstTickInit();
114 
119  virtual void processDestinationChanged();
120 
124  virtual bool setupDestination();
125 
134  virtual void setupDestinationVector() const;
135 
137  virtual void invalidateDestinationVector() const;
138 
147  virtual bool atDestination();
148 
150  virtual void doMoving();
151 
153  virtual double findDesiredHeading();
154 
156  virtual void moveToDestination();
157 
159  virtual void stop();
160 
162  virtual void registerTaskMsgCallbacks();
163 
167  virtual void processModifyVrfObject(DtSimMessage* msg);
168 
171  virtual void processSetLocation(DtSimMessage* msg);
172 
174  virtual bool createPortGroups();
175 
177  virtual bool createPorts();
178 
184  virtual bool createPSR();
185 
186  virtual double distanceToDestination() const;
187 
189  virtual void clearTask();
190 
195  virtual double atDistance() const;
196 
200  virtual void processMoveIntoFormationTask(DtSimMessage* msg);
201 
204  virtual void processTurnToHeadingTask(DtSimMessage* msg);
205 
207  virtual void sendRequestToSelf(const DtSetDataRequest& request) const;
208 
209 protected:
210 
213 
219 
225 
228 
235 
237 
241 
244 
247 
250 
252 
256 
258 
262 
264 };
265 
DtAggregatedMoveToDescriptor * myAggregatedMoveToDescriptor
Definition: aggregatedMoveToController.h:257
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtAggregatedMoveToController is a controller that models movement to a <location> or <waypoint> for a...
Definition: aggregatedMoveToController.h:42
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
class DtAggregatedMoveToPSR:
Definition: aggregatedMoveToPSR.h:27
DtAggregatedMoveToPSR * myProcessState
Container for state data associated with this component.
Definition: aggregatedMoveToController.h:255
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
DtSharedVrfObjectReference myControlPoint
This is looked up once per tick - assumed unchanging while we have control.
Definition: aggregatedMoveToController.h:240
bool myDestinationVectorIsValid
Definition: aggregatedMoveToController.h:246
virtual void registerTaskMsgCallbacks()
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: aggregatedMoveToController.h:234
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
DtVector myWorldDestination
Definition: aggregatedMoveToController.h:243
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
DtOutputPortGroup * myOutputPortGroup
Output Group Name: movement-control .
Definition: aggregatedMoveToController.h:227
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
DtOutputPortGroup is a data port group of a data provider.
Definition: outputPortGroup.h:30
virtual bool init()
Calls setRadio()
DtBooleanOutputPort * myRetrogradeOutputPort
Definition: aggregatedMoveToController.h:263
DtVrfAggregateStateRepository * myAggregateStateRepository
Definition: aggregatedMoveToController.h:251
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtSharedVrfObjectReference class will allocate an empty DtVrfObjectReference if one is not assigned s...
Definition: vrfObjectReference.h:102
DtSetDataRequest is an abstract base class from which real setDataRequests can derive.
Definition: setDataRequest.h:40
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
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
DtVector myLocalDestination
Definition: aggregatedMoveToController.h:242
DtVector myDestinationVector
Definition: aggregatedMoveToController.h:245
virtual void tick()
This gives the thread of control to the component.
virtual bool createPorts()
Called by init.
DtAnalogOutputPort * myMovementDirectionOutputPort
Output Port Name: desired-movement-direction Output Port Description: Specifies the current movement ...
Definition: aggregatedMoveToController.h:218
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
This class manages the distribution of DtSetDataRequests within a single DtVrfObject.
Definition: setDataManager.h:37
bool myAtDestination
Definition: aggregatedMoveToController.h:248
DtAggregatedMoveToDescriptor; descriptor for the DtAggregatedMoveToDescriptor component.
Definition: aggregatedMoveToDescriptor.h:21
DtAnalogOutputPort * mySpeedOutputPort
Output Port Name: desired-speed Output Port Description: Specifies the current speed of the entity in...
Definition: aggregatedMoveToController.h:224
DtSetDataManager * mySetDataManager
Pointer to aggregate's DtSetDataManager, cached in this class for convenience.
Definition: aggregatedMoveToController.h:261
double myDistanceSquared
Definition: aggregatedMoveToController.h:249
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
These functions handle the standard sets that can affect the time estimates.
Definition: vrfAggregateStateRepository.h:22
An instance of DtCgf is an object representing a CGF (Computer Generated Forces). ...
Definition: cgf.h:115

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)