VR-Forces 5.0.1 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 
13 
17 
21 {
22 private:
23  //Not Implemented.
25  //Not Implemented.
27  //Not Implemented.
29 
30 public:
31 
32  //\copydoc DtSimComponent(const DtString&,DtLocalObject*,DtSimulationServices*,
33  //DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
35  DtLocalObject* owner,
36  DtSimulationServices* simManager,
37  DtComponentDescriptor* desc = NULL,
38  DtReaderWriterRegistry* parentRegistry = NULL);
39 
41 
42  //Initial setup of component after creation. Register attribute provider functions.
43  virtual bool init();
44 
45  //Creates the process state repository for this component.
46  virtual bool createPSR();
47 
48  //\copydoc DtSimComponent::type()
49  //\return DtScriptedMovementControllerType.
50  virtual const char* type() const;
51 
52  //Main processing for component.
53  virtual void tick();
54 
56  virtual void setDesiredLocation(const DtVector&);
57 
59  virtual void setDesiredSpeed(const DtVector& velocity, const DtVector& acceleration);
60 
61  virtual void setDesiredRotationalVelocity(const DtVector&);
62 
64  virtual void setDesiredOrientation(const DtTaitBryan&);
65 
66  virtual void clearTask();
67 
69  virtual DtScriptedMovementControllerPSR* getPSR(){return myProcessState;}
70 
75  static DtReaderWriter* provideAnimationFrame(void* controller);
77 
78 protected:
79 
80  virtual void registerTaskMsgCallbacks();
81  static void scriptedMovementTaskCallback(DtSimMessage* msg, void* usr);
82  virtual void processScriptedMovementTask(DtSimMessage* msg);
83 
84  virtual void preFirstTickInit();
85 
86  virtual bool setup();
87 
89  virtual makVrfEvents::DtFireEvent* createFireInteraction();
90 
91  virtual void finishUp();
92  virtual void sendDetonation();
93 
120  static void animatedMovementTaskCallback( DtSimMessage* msg, void* usr );
121  virtual void processAnimatedMovementTask( DtSimMessage* msg );
123 
125  virtual int detonationResultFromDistance( double d, const DtVector& detonationPosition, const DtEntityType& targetType ) const;
126 
127  virtual bool createPortGroups() override;
128  virtual bool createPorts() override;
129 
130  virtual bool createNegateSpeedPort();
131 
132  virtual bool tickWhileDestroyed() const;
133 
135  virtual void setupInitialState();
136 
137  virtual void updateTaskVisualizations();
138 
139 public:
140 
141  //\copydoc DtSimComponent(const DtString&,DtLocalObject*,DtSimulationServices*,
142  //DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
143  //\return New instance of this class.
144  static DtSimComponent * creator( const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
145  DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0 );
146 
147 protected:
148 
152 
156 
164 
166 
167 };
#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:163
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
bool myInitialized
Definition: scriptedMovementController.h:151
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:20
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
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual bool init()
Calls setRadio()
DtScriptedMovementControllerPSR is the process state repository for the scripted movement controller...
Definition: scriptedMovementControllerPSR.h:22
bool myCompleteNextTick
Definition: scriptedMovementController.h:165
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
This controller will process the scripted movement message to move the object along the scripted path...
Definition: scriptedMovementController.h:20
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:436
DtScriptedMovementControllerPSR * myProcessState
Definition: scriptedMovementController.h:149
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:89
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtSimObjectReference myTargetPoint
Definition: scriptedMovementController.h:150
virtual DtScriptedMovementControllerPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: scriptedMovementController.h:69
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:155

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)