VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scriptedMovementController.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
7 
14 
18 
22 {
23 private:
24  //Not Implemented.
26  //Not Implemented.
28  //Not Implemented.
30 
31 public:
32 
33  //\copydoc DtSimComponent(const DtString&,DtLocalObject*,DtSimulationServices*,
34  //DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
36  DtLocalObject* owner,
37  DtSimulationServices* simManager,
38  DtComponentDescriptor* desc = NULL,
39  DtReaderWriterRegistry* parentRegistry = NULL);
40 
42 
43  //Initial setup of component after creation. Register attribute provider functions.
44  virtual bool init();
45 
46  //Creates the process state repository for this component.
47  virtual bool createPSR();
48 
49  //\copydoc DtSimComponent::type()
50  //\return DtScriptedMovementControllerType.
51  virtual const char* type() const;
52 
53  //Main processing for component.
54  virtual void tick();
55 
57  virtual void setDesiredLocation(const DtVector&);
58 
60  virtual void setDesiredSpeed(const DtVector& velocity, const DtVector& acceleration);
61 
62  virtual void setDesiredRotationalVelocity(const DtVector&);
63 
65  virtual void setDesiredOrientation(const DtTaitBryan&);
66 
67  virtual void clearTask();
68 
70  virtual DtScriptedMovementControllerPSR* getPSR(){return myProcessState;}
71 
76  static DtReaderWriter* provideAnimationFrame(void* controller);
78 
79 protected:
80 
81  virtual void registerTaskMsgCallbacks();
82  static void scriptedMovementTaskCallback(DtSimMessage* msg, void* usr);
83  virtual void processScriptedMovementTask(DtSimMessage* msg);
84 
85  virtual void preFirstTickInit();
86 
87  virtual bool setup();
88 
90  virtual makVrfEvents::DtFireEvent* createFireInteraction();
91 
92  virtual void finishUp();
93  virtual void sendDetonation();
94 
121  static void animatedMovementTaskCallback( DtSimMessage* msg, void* usr );
122  virtual void processAnimatedMovementTask( DtSimMessage* msg );
124 
126  virtual int detonationResultFromDistance( double d, const DtVector& detonationPosition, const DtEntityType& targetType ) const;
127 
128  virtual bool createPortGroups() override;
129  virtual bool createPorts() override;
130 
131  virtual bool createNegateSpeedPort();
132 
133  virtual bool tickWhileDestroyed() const;
134 
136  virtual void setupInitialState();
137 
138  virtual void updateTaskVisualizations();
139 
140 public:
141 
142  //\copydoc DtSimComponent(const DtString&,DtLocalObject*,DtSimulationServices*,
143  //DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
144  //\return New instance of this class.
145  static DtSimComponent * creator( const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
146  DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0 );
147 
148 protected:
149 
153 
157 
165 
168 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtBooleanOutputPort * myNegateSpeedPort
Output Port Name: is-action-speed-negated Output Port Description: Indicates that the speed used for ...
Definition: scriptedMovementController.h:164
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
bool myInitialized
Definition: scriptedMovementController.h:152
Definition: fireEvent.h:16
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:22
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
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:49
Definition: readerWriterRegistry.h:39
DtMovementLocalObjectFacade myMovementLocalObjectFacade
Definition: scriptedMovementController.h:167
DtScriptedMovementControllerPSR is the process state repository for the scripted movement controller...
Definition: scriptedMovementControllerPSR.h:22
bool myCompleteNextTick
Definition: scriptedMovementController.h:166
This controller will process the scripted movement message to move the object along the scripted path...
Definition: scriptedMovementController.h:21
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:437
virtual bool init() override
Calls setRadio()
DtScriptedMovementControllerPSR * myProcessState
Definition: scriptedMovementController.h:150
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
virtual bool tickWhileDestroyed() const
If the component returns true here, it will be ticked regardless of the destroyed state of the host e...
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:95
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtSimObjectReference myTargetPoint
Definition: scriptedMovementController.h:151
virtual DtScriptedMovementControllerPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: scriptedMovementController.h:70
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:31
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
Used to update repository with any movement data. As long as this controller has control of this port...
Definition: scriptedMovementController.h:156

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)