VR-Forces 4.10 Class Documentation
 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 <vl/hostStructs.h>
17 #include "vrfutil/simMunition.h"
19 #include "vrfobjcore/boolIOPort.h"
20 
21 class DtObjectIdPort;
22 
25 class DtSimMessage;
28 
57 {
58 
59 public:
60 
63  DtWeaponController(const DtString& name,
64  DtVrfObject* owner,
65  DtSimManager* simManager,
66  DtComponentDescriptor* desc = 0,
67  DtReaderWriterRegistry* parentRegistry = 0);
68 
70  virtual ~DtWeaponController();
71 
74  virtual const char* type() const;
75 
77  virtual bool createMountingController();
78 
79  virtual bool init();
80 
83  virtual void preFirstTickInit();
84 
91  virtual void tick();
92 
94  virtual void fire();
95 
104  virtual const DtVrfObject* chooseTarget();
105 
110  virtual const DtVrfObject * chooseTarget(const DtEntityTargetList& targetList) const;
111 
116  virtual void tickMunitionLoader(const DtVrfObject* target);
117 
138  virtual bool acquireTarget(const DtVrfObject* target);
139 
143  virtual void maneuverRequiredToAcquireTarget(DtReal requiredHeading,
144  DtReal requiredPitch,
145  DtReal requiredMaxSpeed);
146 
148  bool outOfAmmo() const;
149 
154  virtual bool loadedAmmoValidForTarget(const DtVrfObject* target) const;
155 
172  virtual bool chooseAmmo(const DtEntityType& entityType,
173  DtSimMunition& munitionOut, DtDetonatorFuze& fuzeOut,
174  bool setCurrentMunition = true);
175 
181  virtual bool acceptSensorTargettingInput();
182 
186  virtual bool inSector(const DtVrfObject * entity) const;
187 
190  virtual void findBodyHeadingElevationToTarget(const DtVrfObject *entity,
191  DtReal &bodyHeadingOut,
192  DtReal &bodyElevationOut) const;
193 
197  virtual const DtVrfObject * easier(const DtVrfObject * entity1, const DtVrfObject
198  * entity2) const;
199 
203  static DtSimComponent * creator(const DtString& name,
204  DtVrfObject* owner,
205  DtSimManager* simManager,
206  DtComponentDescriptor* desc = 0,
207  DtReaderWriterRegistry* parentRegistry = 0);
208 
209 
210  virtual void enable();
211 
212  virtual void disable();
213 
214 protected:
215 
217  virtual bool createPorts();
218 
220  virtual void addRangeItems();
221 
222 protected:
223 
226 
229 
232  orig);
233 
234 
235 protected:
236 
238 
241 
248 
256 
258 
259 
262 
264 
265  std::map<DtString, DtSimMunition> myUsableMunitions;
266 
268 };
std::map< DtString, DtSimMunition > myUsableMunitions
Definition: weaponController.h:265
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
#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
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
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
DtWeaponController is a controller that extends the DtBaseWeaponController with the ability to accept...
Definition: weaponController.h:56
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtEntityListInputPort * myTargetListPort
Input Port Name: target-list Input Port Description: List of targets detected.
Definition: weaponController.h:247
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
This file contains the class declaration for the.
virtual void disable()
virtual bool createPorts()
Overridden to create input &amp; output ports.
DtMountingController * myMountingController
Definition: weaponController.h:260
const DtBaseWeaponController & operator=(const DtBaseWeaponController &orig)
assignment operator; not implemented
virtual void enable()
Is this component enabled or not.
Contains class declarations for DtEntityListInputPort, DtEntityListOutputPort, and DtEntityListPortDa...
Definition: entListIOPort.h:27
File: simMsg.h.
Definition: simMessage.h:35
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
DtWeaponComponentInterface * myWeaponComponentInterface
Definition: weaponController.h:263
virtual void fire()
fires the weapon
virtual bool createMountingController()
Creates myBaseMountingController.
DtUUID myCurrentTarget
Definition: weaponController.h:237
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.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
const DtWeaponControllerDescriptor * myWeaponCtlrDesc
Definition: weaponController.h:261
double myMaxMunitionEffectiveRange
Definition: weaponController.h:267
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
DtSimMunition class.
Definition: simMunition.h:34
DtBooleanInputPort * myWeaponsHoldPort
Input Port Name: weapons-hold Input Port Description: When true, all firing of missiles is disabled...
Definition: weaponController.h:255
Represents the interface between the DtTargetSelectionController and a weapon system.
Definition: weaponComponentInterface.h:21
DtWeaponControllerDescriptor; descriptor for the DtWeaponController component.
Definition: weaponControllerDescriptor.h:25

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)