VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
launcherController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 #include <vl/detonationInteraction.h>
16 
17 class DtLauncherControllerDescriptor;
19 class DtVectorOutputPort;
20 class DtEvent;
21 
57 {
58 
59 public:
60 
63  DtLauncherController(const DtString& name,
64  DtVrfObject* owner,
65  DtSimManager* simManager,
66  DtComponentDescriptor* desc = 0,
67  DtReaderWriterRegistry* parentRegistry = 0);
68 
70  virtual ~DtLauncherController();
71 
74  virtual bool init();
75 
78  virtual const char* type() const;
79 
84  virtual void preFirstTickInit();
85 
87  virtual void tick();
88 
91  virtual bool createMissileIdPort();
92  virtual DtObjectIdOutputPort * missileIdPort() const;
93 
94  virtual bool createTargetPointPort();
95  virtual DtVectorOutputPort * targetPointPort() const;
96 
97  virtual bool createTargetEntityIdPort();
98  virtual DtObjectIdOutputPort * targetEntityIdPort() const;
99 
106  virtual void fire();
107 
114  virtual void missileDetonated(DtDetonationInteraction * detInter);
115 
119  virtual void detonationCallback(const DtEvent& e);
120 
129  virtual void disconnectMissileFromLauncher(const DtEntityIdentifier& missId);
130 
131  virtual void disconnectMissileFromLauncher(const DtVrfObject *missile);
132 
134  virtual const DtVrfObject* mostRecentMissileFired();
135 
139  virtual bool missilePassedTarget(const DtVrfObject* lastMissile, double& distSquaredToTargetOut);
140 
141  virtual double abandonPassedMissileDistance();
142  virtual void setAbandonPassedMissileDistance(const double& distance);
143 
147  virtual void registerAttributeFunctions();
148 
152  static DtReaderWriter* provideLastMissileName(void* controller);
153 
157  static DtReaderWriter* provideMissilePassedTarget(void* controller);
158 
159 
163  static DtSimComponent * creator(const DtString& name,
164  DtVrfObject* owner,
165  DtSimManager* simManager,
166  DtComponentDescriptor* desc = 0,
167  DtReaderWriterRegistry* parentRegistry = 0);
168 
169 protected:
170 
172  virtual bool createPorts();
173 
175  virtual DtReaderWriter* processProvideLastMissileName();
176 
178  virtual DtReaderWriter* processProvideMissilePassedTarget();
179 
182  virtual void removeMissileFromActiveList(const DtEntityIdentifier& removeId);
183 
184  static void deleteVrfObjectCallback(const DtVrfObject* msg, void * usr);
185  virtual void processDeleteVrfObject(const DtVrfObject *msg);
186 
187 protected:
188 
191 
194 
197  orig);
198 
199 
200 protected:
201 
204 
207 
214 
221 
228 
230 
235 
237 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVectorOutputPort * myTargetPointPort
Output Port Name: target-point Output Port Description: Local position of the target.
Definition: launcherController.h:227
const DtWeaponController & operator=(const DtWeaponController &orig)
assignment operator; not implemented
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtWeaponController is a controller that extends the DtBaseWeaponController with the ability to accept...
Definition: weaponController.h:56
DtList myActiveMissiles
Definition: launcherController.h:203
DtObjectIdOutputPort * myMissileIdPort
Output Port Name: missile-id Output Port Description: Object id of the missile.
Definition: launcherController.h:213
bool myRegisteredRemovedCallback
Definition: launcherController.h:236
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
virtual void tick()
If the myWaitingForFire flag is set and the munition loader is still loaded, the weapon has not fired...
Definition: readerWriterRegistry.h:39
virtual void preFirstTickInit()
Starts with weapon loaded, if the weapon has a full complement of ammunition.
Definition: events.h:49
DtLauncherController is a controller that accepts input from a target sensor, and provides ammunition...
Definition: launcherController.h:56
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points.
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
virtual const char * type() const
Returns a string identifies the class type of component.
DtDetonationPdu DtDetonationInteraction
Definition: DistributedSimulationDriver3A.h:14
*array controller(no time code)*/template< class Instance
//!//!//!//!//!//!//!//!//!//!//!//
DtObjectIdOutputPort * myTargetEntityIdPort
Output Port Name: target-entity Output Port Description: Object id of the target. ...
Definition: launcherController.h:220
Instances of DtObjectIdOutputPort are output ports through which data producers can send DtEntityIden...
Definition: objectIdIOPort.h:47
virtual bool init()
Overridden to initialize values obtained from the descriptor.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
double myAbandonPassedMissileDistance
If the missile passes its target within this distance, it will be abandoned and disconnected from the...
Definition: launcherController.h:234
virtual void registerAttributeFunctions()
Called to register functions that provide system attribute values.
Definition: simComponent.h:151
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
DtIfCreateVrfObject myCreateMissileInfo
Definition: launcherController.h:202
virtual bool createPorts()
Overridden to create the local ports.
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual void fire()
updates weapon interface
class DtIfCreateVrfObject:
Definition: ifCreateVrfObject.h:84

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)