VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
weaponActuator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1999 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 #pragma once
12 
14 #include <vl/fireInteraction.h>
15 #include <vl/detonationInteraction.h>
16 #include "vrfcore/timer.h"
17 #include <vl/hostStructs.h>
18 
19 class DtSimManager;
21 class DtVrfWeaponPSR;
22 
24 class DtDcm;
25 
28 class DtBooleanInputPort;
30 
51 {
52 
53 public:
54 
57  DtWeaponActuator(const DtString& name,
58  DtVrfObject* owner,
59  DtSimManager* simManager,
60  DtComponentDescriptor* desc = 0,
61  DtReaderWriterRegistry* parentRegistry = 0);
62 
64  virtual ~DtWeaponActuator();
65 
69  virtual bool init();
70 
73  virtual const char* type() const;
74 
76  virtual void tick();
77 
79  virtual bool postAddComponentsInit();
80 
83  virtual void fireTheWeapon();
84 
86  virtual DtFireInteraction * createFireInteraction();
87 
88  virtual void setProjectileStartSpeed(DtReal startSpeed);
89  virtual DtReal projectileStartSpeed();
90 
91  virtual void setMuzzleOffset(const DtVector& muzzleOffset);
92  virtual const DtVector& muzzleOffset();
93 
105  virtual DtVector muzzleLocalPosition();
106 
114  virtual DtDcm weaponOrientation();
115 
123  virtual DtArticulatedPartStateRepository * getWeaponSimBody();
124 
125 
129  static DtSimComponent * creator(const DtString& name,
130  DtVrfObject* owner,
131  DtSimManager* simManager,
132  DtComponentDescriptor* desc = 0,
133  DtReaderWriterRegistry* parentRegistry = 0);
134 
135 protected:
136 
138  virtual bool createPortGroups();
139 
141  virtual bool createPorts();
142 
148  virtual bool createPSR();
149 
150 protected:
151 
154 
156  DtWeaponActuator(const DtWeaponActuator & orig);
157 
159  const DtWeaponActuator & operator=(const DtWeaponActuator & orig);
160 
161 
162 protected:
163 
166 
170 
177 
185 
192 
199 
203 
211 
213 
215 
218 
222  DtEventId myCurrentEventId;
225 
226 };
227 
DtReal myProjectileStartSpeed
Definition: weaponActuator.h:216
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:144
DtConstrainedIntegerInputPort * myFusePort
Input Port Name: fuze Input Port Description: DIS Enumeration for fuze (see DIS Enumeration and Bit E...
Definition: weaponActuator.h:184
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Contains class declarations for DtAmmunitionInputPort, DtAmmunitionOutputPort, and DtAmmunitionPortDa...
Definition: ammunitionIOPort.h:28
DtBooleanInputPort * myTriggerPort
Input Port Name: trigger Input Port Description: True to fire.
Definition: weaponActuator.h:191
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
virtual bool init()
Overridden to cache a pointer to the entity&#39;s radio in this class.
DtAmmunitionInputPort * myAmmunitionPort
Input Port Name: ammunition Input Port Description: Type of ammo to fire.
Definition: weaponActuator.h:176
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
DtReal myCurrentRange
Definition: weaponActuator.h:223
Definition: readerWriterRegistry.h:39
DtOutputPortGroup is a data port group of a data provider.
Definition: outputPortGroup.h:30
File: weaponPSR.h.
Definition: vrfWeaponPSR.h:31
DtIntegerOutputPort * myArtPartTypePort
Output Port Name: art-part-type Output Port Description: Type of the articulated part.
Definition: weaponActuator.h:210
DtInputPortGroup * myWeaponInputPortGroup
Input Port Group Name: weapon-control Input Port Group Description:
Definition: weaponActuator.h:169
End User Description: DtActuator is the base class for all actuator model components.
Definition: actuatorComponent.h:48
DtSharedVrfObjectReference class will allocate an empty DtVrfObjectReference if one is not assigned s...
Definition: vrfObjectReference.h:102
DtEventId myCurrentEventId
Definition: weaponActuator.h:222
DtWeaponActuator is a simple model of a ballistic gun.
Definition: weaponActuator.h:50
virtual void tick()
This gives the thread of control to the component.
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:29
DtSharedVrfObjectReference myCurrentEntityTarget
These are set by createFireInteraction and used by createDetonationInteraction.
Definition: weaponActuator.h:221
virtual bool createPorts()
Called by init.
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtOutputPortGroup * myWeaponOutputPortGroup
Output Port Group Name: weapon-info Output Port Group Description:
Definition: weaponActuator.h:202
DtInputPortGroup is a data port group of a data consumer.
Definition: inputPortGroup.h:32
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
DtWeaponActuatorDescriptor * myWeaponActuatorDescriptor
Definition: weaponActuator.h:214
DtWeaponActuatorDescriptor; descriptor for the DtWeaponActuator component.
Definition: weaponActuatorDescriptor.h:24
DtBooleanInputPort * myLoadedPort
Input Port Name: loaded Input Port Description: True if loaded.
Definition: weaponActuator.h:198
virtual const char * type() const =0
Returns a string identifies the class type of component.
DtVrfWeaponPSR * myWeaponProcessState
Definition: weaponActuator.h:224
Contains class declarations for DtConstrainedIntegerInputPort and DtConstrainedIntegerOutputPort.
Definition: constrainedIntegerIOPort.h:26
DtVector myMuzzleOffset
Definition: weaponActuator.h:217

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)