VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
laserGuidedLauncherController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 #pragma once
11 
14 
16 class DtLaserLauncherPSR;
17 class DtReflectedDesignator;
18 class DtVectorOutputPort;
19 class DtSimMessage;
20 
29 {
30 private:
37 
38 public:
39 
43  DtSimManager* simManager, DtComponentDescriptor* compDesc = 0,
44  DtReaderWriterRegistry* parentRegistry = 0);
45 
48 
51  virtual const char* type() const;
52 
55  virtual bool init();
56 
58  virtual void setComponentDescriptor(DtComponentDescriptor *compDesc);
59 
65  virtual bool createPSR();
66 
70  virtual void preFirstTickInit();
71 
73  virtual void tick();
74 
78  static DtSimComponent * creator(const DtString& name,
79  DtVrfObject* owner,
80  DtSimManager* simManager,
81  DtComponentDescriptor* desc = 0,
82  DtReaderWriterRegistry* parentRegistry = 0);
83 
84 protected:
85 
87  virtual void addRangeItems();
88 
89  virtual bool createPorts();
90 
93  virtual bool missileResourceAvailable() const;
94 
96  virtual void consumeMissileResource();
97 
99  virtual bool fireMunition(DtReflectedDesignator* target);
100 
104  virtual DtVrfObject* createMissileObject();
105 
108  virtual void createAndSendFireInteraction(const DtVrfObject* missile,
109  DtReflectedDesignator* targetDesignator,
110  const DtEventId& eventId);
111 
119  virtual DtReflectedDesignator* chooseTarget(bool& targetInFireCone, DtVector& targetLocalPosition);
120 
127  virtual bool targetDesginatorValid(DtReflectedDesignator* target,
128  DtVector& targetLocalPosition);
129 
131  virtual bool targetDesginatorInFireCone(DtReflectedDesignator* target);
132 
135  virtual bool munitionLoaded() const;
136 
139  virtual DtVector launcherGeocentricPosition() const;
140 
143  virtual DtVector launcherLocalPosition() const;
144 
146  virtual bool missileInFlight();
147 
149  virtual int defaultLaserCode() const;
150 
152  virtual bool permissionToFire(const DtVector& localSpotPosition) const;
153 
155  virtual bool canFireAtBasedOnTargetPriorityListRoe(const DtVrfObject*) const;
156 
158 
159  static void setLaserCodeRequestCallback(DtSimMessage* msg, void* usrData);
160  virtual void processSetLaserCodeRequestMessage(DtSimMessage* msg);
162 
165 
166  static void setSyncLaserCodeCallback(DtSimMessage* msg, void* usr);
167  virtual void processSetSyncLaserCode(DtSimMessage* msg);
169 
170 protected:
173 
177 
179 
180  DtVectorOutputPort* myTargetLocationOutputPort;
188 
194 };
#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
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
const DtLaserGuidedLauncherControllerDescriptor * myDescriptor
Pointer to my descriptor.
Definition: laserGuidedLauncherController.h:172
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
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 bool init()
Calls setRadio()
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
DtLaserLauncherPSR * myProcessState
Container for state data associated with this component.
Definition: laserGuidedLauncherController.h:176
virtual void setComponentDescriptor(DtComponentDescriptor *componentDescriptor)
The component descriptor specified in the order of battle file or parameter file that was used to cre...
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
virtual bool createPorts()
Called by init.
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:29
File: laserLauncherPSR.h.
Definition: laserLauncherPSR.h:34
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
Parameters for the DtLaserGuidedLauncherController.
Definition: laserGuidedLauncherControllerDescriptor.h:28
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
End User Description: This is a missile launcher controller/actuator combination (does not need to be...
Definition: laserGuidedLauncherController.h:28
bool myTargetWasFoundLastTick
A state variable to remember that a target was found the tick before the current tick; used to delay ...
Definition: laserGuidedLauncherController.h:193

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)