VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
groundFollowEntityController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
15 
16 #include <vlutil/vlString.h>
17 #include <matrix/vlVector.h>
18 #include <vlpi/trigonometricSmoother.h>
19 
20 class DtSimManager;
21 class DtSimMessage;
22 class DtStringOutputPort;
24 
35 {
36 
37 public:
38 
42  DtVrfObject* owner,
43  DtSimManager* simManager,
44  DtComponentDescriptor* desc = 0,
45  DtReaderWriterRegistry* parentRegistry = 0);
46 
49 
52  virtual const char* type() const;
53 
54 
58  static void followEntityCallback(DtSimMessage* msg, void* usrData);
59 
60  virtual void processFollowEntityTask(DtSimMessage* msg);
61 
62  virtual DtVector predictedDestination();
63 
68  virtual const DtUUID& entityToFollow();
69  virtual void setEntityToFollow(const DtUUID& entity);
70 
73  virtual const DtVector& offsetVector() const;
74  virtual void setOffsetVector(const DtVector& offsets);
75 
79  static DtSimComponent * creator(const DtString& name,
80  DtVrfObject* owner,
81  DtSimManager* simManager,
82  DtComponentDescriptor* desc = 0,
83  DtReaderWriterRegistry* parentRegistry = 0);
84 
86  virtual void registerTaskMsgCallbacks();
87 
91  virtual bool setupDestination();
92 
95  virtual bool passedDestination();
96 
99  virtual double findDesiredSpeed();
100 
104  virtual double findDesiredHeading();
105 
111  virtual void setupDestinationVector() const;
112 
118 
122  virtual void stop();
123 
125  virtual void tick();
126 
128  virtual bool usingNavBot(){return false;}
129 
131  virtual void updateNavBotDestination();
132 
134  virtual bool needToUpdateNavInterfaceDestination(const DtVector& newLocalDestination);
135 
136 protected:
140 
143  orig);
144 
148 
149  virtual bool createPorts();
150 
152  static void objectAboutToBeRemovedCallback(const DtVrfObject*, void* usr);
153  virtual void processObjectAboutToBeRemoved(const DtVrfObject*);
154 
155 protected:
156 
158 
161 
163 
164  DtTrigonometricSmoother* myLeaderSmoother;
165 
167 
169 
171 
174 };
175 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual void registerTaskMsgCallbacks()
Overridden to register interest in move to and set location commands.
Instances of DtStringOutputPort are output ports through which data producers can send a DtString obj...
Definition: stringIOPort.h:52
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtTrigonometricSmoother * myLeaderSmoother
Definition: groundFollowEntityController.h:164
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
DtVector myNavInterfaceCurrentDestination
Definition: groundFollowEntityController.h:170
virtual void stop()
Set port values for stopping, and mark the task complete.
virtual void tick()
Looks at the value on myCollisionAvoidancePort, and if there is a value and the destination point is ...
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 double findDesiredSpeed()
Determines how fast we should go.
A DtGroundMoveToDescriptor that has the speed ratios to use when at, near, or past the desired locati...
Definition: groundFollowEntityDescriptor.h:30
DtGroundFollowEntityDescriptor * myComponentDescriptor
Definition: groundFollowEntityController.h:157
virtual const char * type() const
Returns a string identifies the class type of component.
DtGroundMoveToDestinationControllerComponent is a controller that provides a kinematics-based model o...
Definition: groundMoveToDestinationControllerComponent.h:38
const DtGroundMoveToDestinationControllerComponent & operator=(const DtGroundMoveToDestinationControllerComponent &orig)
assignment operator; see comments on copy constructor!
File: simMsg.h.
Definition: simMessage.h:35
double myNavInterfaceDestinationSetTime
Definition: groundFollowEntityController.h:168
DtStringOutputPort * myFollowEntityOutputPort
Definition: groundFollowEntityController.h:162
bool myWarnedOnceDestroyed
Definition: groundFollowEntityController.h:172
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:24
virtual bool setupDestination()
This function ensures that the destination stored in the process state matches the member function...
virtual bool passedDestination()
Determines if the entity will pass the destination to which it is moving this frame if it continues a...
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
virtual double findDesiredHeading()
Determines the desired heading in the following manner: If the myNearDestination member variable is t...
DtVector myPredictedDestination
Definition: groundFollowEntityController.h:166
virtual bool usingNavBot()
Definition: groundFollowEntityController.h:128
const DtVrfObject * myLeaderPointer
Set fresh each frame by setupDestination()
Definition: groundFollowEntityController.h:160
virtual DtAutoTransmissionGearEnum determineGearSetting()
Sets myProcessState-&gt;myCurrentGear to DtAutoGearReverse or DtAutoGearForward based on sign of ordered...
virtual bool createPorts()
Overridden to create the automotive ports.
virtual void setupDestinationVector() const
Sets up a vector from the current destination location to the entity&#39;s location to use in determining...
DtGroundFollowEntityController is a controller that models following behavior for ground vehicles...
Definition: groundFollowEntityController.h:34
bool myRemoveCallbackAssigned
Definition: groundFollowEntityController.h:173

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)