VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
weaponController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
12 
13 #pragma once
14 
16 #include "vrfutil/simMunition.h"
18 #include "vrfobjcore/boolIOPort.h"
19 
20 class DtObjectIdPort;
21 
24 class DtSimMessage;
27 
56 {
57 
58 public:
59 
62  DtWeaponController(const DtString& name,
63  DtLocalObject* owner,
64  DtSimulationServices* simManager,
65  DtComponentDescriptor* desc = 0,
66  DtReaderWriterRegistry* parentRegistry = 0);
67 
69  virtual ~DtWeaponController();
70 
73  virtual const char* type() const;
74 
76  virtual bool createMountingController();
77 
78  virtual bool init();
79 
82  virtual void preFirstTickInit();
83 
90  virtual void tick();
91 
93  virtual void fire();
94 
103  virtual const DtSimObject* chooseTarget();
104 
109  virtual DtSimObjectReference chooseTarget(const DtEntityTargetList& targetList) const;
110 
115  virtual void tickMunitionLoader(const DtSimObject* target);
116 
137  virtual bool acquireTarget(const DtSimObject* target);
138 
142  virtual void maneuverRequiredToAcquireTarget(DtReal requiredHeading,
143  DtReal requiredPitch,
144  DtReal requiredMaxSpeed);
145 
147  bool outOfAmmo() const;
148 
153  virtual bool loadedAmmoValidForTarget(const DtSimObject* target) const;
154 
171  virtual bool chooseAmmo(const DtEntityType& entityType,
172  DtSimMunition& munitionOut, DtDetonatorFuze& fuzeOut,
173  bool setCurrentMunition = true);
174 
180  virtual bool acceptSensorTargettingInput();
181 
185  virtual bool inSector(const DtSimObject* entity) const;
186 
189  virtual void findBodyHeadingElevationToTarget(const DtSimObject* entity,
190  DtReal &bodyHeadingOut,
191  DtReal &bodyElevationOut) const;
192 
196  virtual DtSimObjectReference easier(DtSimObjectReference entity1, DtSimObjectReference entity2) const;
197 
201  static DtSimComponent * creator(const DtString& name,
202  DtLocalObject* owner,
203  DtSimulationServices* simManager,
204  DtComponentDescriptor* desc = 0,
205  DtReaderWriterRegistry* parentRegistry = 0);
206 
207 
208  virtual void enable();
209 
210  virtual void disable();
211 
212 protected:
213 
215  virtual bool createPorts();
216 
218  virtual void addRangeItems();
219 
220 protected:
221 
224 
227 
230  orig);
231 
232 
233 protected:
234 
236 
239 
246 
254 
256 
257 
260 
262 
263  std::map<DtString, DtSimMunition> myUsableMunitions;
264 
266 };
std::map< DtString, DtSimMunition > myUsableMunitions
Definition: weaponController.h:263
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtMountingController; models rotation of a launcher.
Definition: mountingController.h:23
virtual void tick()
Sets the current dT on the base mounting controller and ticks it.
DtBaseWeaponController is a controller that creates the ports needed to choose ammo for...
Definition: baseWeaponController.h:33
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtWeaponController is a controller that extends the DtBaseWeaponController with the ability to accept...
Definition: weaponController.h:55
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
DtEntityListInputPort * myTargetListPort
Input Port Name: target-list Input Port Description: List of targets detected. Input Port Range: Inp...
Definition: weaponController.h:245
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
This file contains the class declaration for the.
virtual void disable()
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
virtual bool createPorts()
Overridden to create input &amp; output ports.
DtMountingController * myMountingController
Definition: weaponController.h:258
const DtBaseWeaponController & operator=(const DtBaseWeaponController &orig)
assignment operator; not implemented
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual void enable()
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:29
File: simMsg.h.
Definition: simMessage.h:35
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtWeaponComponentInterface * myWeaponComponentInterface
Definition: weaponController.h:261
virtual void fire()
fires the weapon
virtual bool createMountingController()
Creates myBaseMountingController.
DtUUID myCurrentTarget
Definition: weaponController.h:235
virtual bool init()
Overridden to initialize values obtained from the descriptor.
virtual const char * type() const
Returns a string identifies the class type of component. Type values are defined in compTypes...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
const DtWeaponControllerDescriptor * myWeaponCtlrDesc
Definition: weaponController.h:259
double myMaxMunitionEffectiveRange
Definition: weaponController.h:265
DtSimMunition class.
Definition: simMunition.h:31
DtBooleanInputPort * myWeaponsHoldPort
Input Port Name: weapons-hold Input Port Description: When true, all firing of missiles is disabled...
Definition: weaponController.h:253
Represents the interface between the DtTargetSelectionController and a weapon system.
Definition: weaponComponentInterface.h:20
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
DtWeaponControllerDescriptor; descriptor for the DtWeaponController component.
Definition: weaponControllerDescriptor.h:25

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)