VR-Forces 5.0.2 Developer's Guide
 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 
17 #include "vrfcore/timer.h"
18 
21 class DtVrfWeaponPSR;
22 
23 class DtDcm;
24 
27 class DtBooleanInputPort;
29 
30 namespace makVrf
31 {
32  class DtArticulatedPartStateRepository;
33 }
34 
55 {
56 
57 public:
58 
61  DtWeaponActuator(const DtString& name,
62  DtLocalObject* owner,
63  DtSimulationServices* simManager,
64  DtComponentDescriptor* desc = 0,
65  DtReaderWriterRegistry* parentRegistry = 0);
66 
68  virtual ~DtWeaponActuator();
69 
73  virtual bool init();
74 
77  virtual const char* type() const;
78 
80  virtual void tick();
81 
83  virtual bool postAddComponentsInit();
84 
87  virtual void fireTheWeapon();
88 
90  virtual makVrfEvents::DtFireEvent * createFireInteraction();
91 
92  virtual void setProjectileStartSpeed(DtReal startSpeed);
93  virtual DtReal projectileStartSpeed();
94 
95  virtual void setMuzzleOffset(const DtVector& muzzleOffset);
96  virtual const DtVector& muzzleOffset();
97 
109  virtual DtVector muzzleLocalPosition();
110 
118  virtual DtDcm weaponOrientation();
119 
127  virtual const makVrf::DtArticulatedPartStateRepository * getWeaponSimBody();
128 
129 
133  static DtSimComponent * creator(const DtString& name,
134  DtLocalObject* owner,
135  DtSimulationServices* simManager,
136  DtComponentDescriptor* desc = 0,
137  DtReaderWriterRegistry* parentRegistry = 0);
138 
139 protected:
140 
142  virtual bool createPortGroups();
143 
145  virtual bool createPorts();
146 
152  virtual bool createPSR();
153 
154 protected:
155 
158 
160  DtWeaponActuator(const DtWeaponActuator & orig);
161 
163  const DtWeaponActuator & operator=(const DtWeaponActuator & orig);
164 
165 
166 protected:
167 
170 
174 
181 
189 
196 
203 
207 
215 
217 
219 
222 
229 
232 };
233 
DtReal myProjectileStartSpeed
Definition: weaponActuator.h:220
#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:107
DtConstrainedIntegerInputPort * myFusePort
Input Port Name: fuze Input Port Description: DIS Enumeration for fuze (see DIS Enumeration and Bit E...
Definition: weaponActuator.h:188
Contains class declarations for DtAmmunitionInputPort, DtAmmunitionOutputPort, and DtAmmunitionPortDa...
Definition: ammunitionIOPort.h:28
DtBooleanInputPort * myTriggerPort
Input Port Name: trigger Input Port Description: True to fire. Input Port Range: Input Port Default ...
Definition: weaponActuator.h:195
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
Definition: fireEvent.h:16
virtual bool init()
Overridden to cache a pointer to the entity's radio in this class.
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
DtAmmunitionInputPort * myAmmunitionPort
Input Port Name: ammunition Input Port Description: Type of ammo to fire. Input Port Range: Input Po...
Definition: weaponActuator.h:180
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtReal myCurrentRange
Definition: weaponActuator.h:227
Definition: readerWriterRegistry.h:39
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
File: weaponPSR.h.
Definition: vrfWeaponPSR.h:33
DtIntegerOutputPort * myArtPartTypePort
Output Port Name: art-part-type Output Port Description: Type of the articulated part. See the DIS Enumeration and Bit Encoded Values document for values. Output Port Range: Output Port Default Value: Output Group Parent: weapon-info.
Definition: weaponActuator.h:214
DtInputPortGroup * myWeaponInputPortGroup
Input Port Group Name: weapon-control Input Port Group Description:
Definition: weaponActuator.h:173
End User Description: DtActuator is the base class for all actuator model components. Developer Description: The DtActuator base class caches a pointer to the entity's radio for convenience. Derived classes may have articulated parts that are configured from the DtActuatorComponentDescriptor's DtSimArtPartDescriptorList. For each articulated part in the list a DtArticulatedPartStateRepository will be created to store the data for the part such as it's location, rotation and so forth. These are created in the entity's DtVrfObjectStateRepository createParts() function. This call creates all the attached parts for all the actuators. These articulated state repositories are managed by the DtAttachmentManager. They are cached by their partType which is the DIS Enumeration describing the part from the disEnums.h file and was specified in the actuator's DtActuatorComponentDescriptor as descriped above. The partType is used as the category of the DtObjectType used to look up articulated parts in the DtAttachementManager. When an actuator needs access to a particular articulated part it looks it up by the part's object type.
Definition: actuatorComponent.h:47
DtWeaponActuator is a simple model of a ballistic gun.
Definition: weaponActuator.h:54
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
Contains class declarations for DtBooleanInputPort, DtBooleanOutputPort, and DtBooleanPortData.
Definition: boolIOPort.h:25
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
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
DtOutputPortGroup * myWeaponOutputPortGroup
Output Port Group Name: weapon-info Output Port Group Description:
Definition: weaponActuator.h:206
DtSimObjectReference myCurrentEntityTarget
These are set by createFireInteraction and used by createDetonationInteraction.
Definition: weaponActuator.h:225
DtInputPortGroup is a data port group of a data consumer. It may contain any number of DtInputPorts a...
Definition: inputPortGroup.h:35
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:40
Instances of DtIntegerOutputPort are output ports through which data producers can send integer value...
Definition: integerIOPort.h:45
DtWeaponActuatorDescriptor * myWeaponActuatorDescriptor
Definition: weaponActuator.h:218
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Member to allow for access to platform specific data.
Definition: weaponActuator.h:231
DtWeaponActuatorDescriptor; descriptor for the DtWeaponActuator component.
Definition: weaponActuatorDescriptor.h:24
DtBooleanInputPort * myLoadedPort
Input Port Name: loaded Input Port Description: True if loaded. Input Port Range: Input Port Default...
Definition: weaponActuator.h:202
DtString myCurrentEventId
Definition: weaponActuator.h:226
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtVrfWeaponPSR * myWeaponProcessState
Definition: weaponActuator.h:228
Contains class declarations for DtConstrainedIntegerInputPort and DtConstrainedIntegerOutputPort.
Definition: constrainedIntegerIOPort.h:26
DtVector myMuzzleOffset
Definition: weaponActuator.h:221
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

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)