VR-Forces 4.8 Class Documentation
 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) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
11 #include "vl/fireInteraction.h"
13 
16 
20 {
21 private:
22  //Not Implemented.
24  //Not Implemented.
26  //Not Implemented.
28 
29 public:
30 
31  //\copydoc DtSimComponent(const DtString&,DtVrfObject*,DtSimManager*,
32  //DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
34  DtVrfObject* owner,
35  DtSimManager* simManager,
36  DtComponentDescriptor* desc = NULL,
37  DtReaderWriterRegistry* parentRegistry = NULL);
38 
40 
41  //Initial setup of component after creation. Register attribute provider functions.
42  virtual bool init();
43 
44  //Creates the process state repository for this component.
45  virtual bool createPSR();
46 
47  //\copydoc DtSimComponent::type()
48  //\return DtScriptedMovementControllerType.
49  virtual const char* type() const;
50 
51  //Main processing for component.
52  virtual void tick();
53 
55  virtual void setDesiredLocation(const DtVector&);
56 
58  virtual void setDesiredSpeed(const DtVector& velocity, const DtVector& acceleration);
59 
60  virtual void setDesiredRotationalVelocity(const DtVector&);
61 
63  virtual void setDesiredOrientation(const DtTaitBryan&);
64 
65  virtual void clearTask();
66 
68  virtual DtScriptedMovementControllerPSR* getPSR(){return myProcessState;}
69 
74  static DtReaderWriter* provideAnimationFrame(void* controller);
76 
77 protected:
78 
79  virtual void registerTaskMsgCallbacks();
80  static void scriptedMovementTaskCallback(DtSimMessage* msg, void* usr);
81  virtual void processScriptedMovementTask(DtSimMessage* msg);
82 
83  virtual void preFirstTickInit();
84 
85  virtual bool setup();
86 
88  virtual DtFireInteraction* createFireInteraction() const;
89 
90  virtual void finishUp();
91  virtual void sendDetonation();
92 
95 
96  static void objectAboutToBeRemovedCallback(const DtVrfObject* object, void* usr);
97  virtual void processObjectAboutToBeRemoved(const DtVrfObject* object);
99 
125 
126  static void animatedMovementTaskCallback(DtSimMessage* msg, void* usr);
127  virtual void processAnimatedMovementTask(DtSimMessage* msg);
129 
131  virtual int detonationResultFromDistance(double d, const DtVector& detonationPosition, const DtEntityType& targetType) const;
132 
133  virtual bool createPortGroups();
134 
135  virtual bool tickWhileDestroyed() const;
136 
138  virtual void setupInitialState();
139 
140  virtual void updateTaskVisualizations();
141 
142 public:
143 
144  //\copydoc DtSimComponent(const DtString&,DtVrfObject*,DtSimManager*,
145  //DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)
146  //\return New instance of this class.
147  static DtSimComponent * creator(const DtString& name,
148  DtVrfObject* owner,
149  DtSimManager* simManager,
150  DtComponentDescriptor* desc = 0,
151  DtReaderWriterRegistry* parentRegistry = 0);
152 
153 protected:
157 
162 
164 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
bool myInitialized
Definition: scriptedMovementController.h:156
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.
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:163
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:19
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:485
DtScriptedMovementControllerPSR * myProcessState
Definition: scriptedMovementController.h:154
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
virtual bool tickWhileDestroyed() const
If the component returns true here, it will be ticked regardless of the destroyed state of the host e...
*array controller(no time code)*/template< class Instance
//!//!//!//!//!//!//!//!//!//!//!//
const DtVrfObject * myTargetPoint
Definition: scriptedMovementController.h:155
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
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
virtual DtScriptedMovementControllerPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: scriptedMovementController.h:68
DtUpdateRepositoryOutputPortGroup is a data port group of a data consumer that contains methods and p...
Definition: updateRepositoryOutputPortGroup.h:28
DtUpdateRepositoryOutputPortGroup * myUpdateRepositoryOutputPortGroup
Used to update repository with any movement data.
Definition: scriptedMovementController.h:161

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)