16 #include <vl/hostStructs.h>
18 #include <vlpi/disEnums.h>
68 virtual const char*
type()
const;
83 virtual bool createTriggerPort();
86 virtual bool createQuantityOutputPort();
89 virtual bool createLoadedPort();
92 virtual bool createLosOutputPort();
95 virtual bool createLosInputPort();
98 virtual bool createWeaponsHoldInputPort();
100 virtual bool createTargetToAcquireOutputPort();
102 virtual void setLoadAmmoTime(
DtTime loadAmmoTime);
103 virtual DtTime loadAmmoTime()
const;
105 virtual void setUnloadAmmoTime(
DtTime unloadAmmoTime);
106 virtual DtTime unloadAmmoTime()
const;
122 virtual bool chooseAmmo(
const DtEntityType& targetType,
124 munition, DtDetonatorFuze& fuze,
int& ammoAvailable);
128 virtual bool ammoOKToUse(
const DtEntityType& targetType);
131 virtual void initProcessSR();
163 virtual void lookupAndCacheProcessSR();
178 void getMunitionResources(std::list<DtString>& resourceList);
181 virtual void updateResourceList();
185 virtual bool weaponsHoldState();
190 static void setResourceCallback(
DtSimMessage * msg,
void * usrData);
197 static void setRestoreCallback(
DtSimMessage * msg,
void * usrData);
202 bool outOfAmmo()
const;
DtWeaponComponentInterface * myWeaponComponentInterface
Interface between this weapon controller and the entity's DtTargetSelectionController.
Definition: ballisticGunController.h:310
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
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:144
DtBooleanOutputPort * myTriggerPort
Output Port Name: trigger Output Port Description: Sends a new True value when trigger is pulled...
Definition: ballisticGunController.h:233
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
DtOutputPortGroup * myGunControlPortGroup
Output Port Group Name: gun-control Output Port Group Description:
Definition: ballisticGunController.h:260
DtEntityListOutputPort * myTargetToAcquireOutputPort
Output Port Name: target-to-acquire Output Port Description: When there is a target in the weapon int...
Definition: ballisticGunController.h:274
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
DtIntegerOutputPort * myLosOutputPort
Output Port Name: line-of-sight Output Port Description: Indicates the result of a line of sight calc...
Definition: ballisticGunController.h:256
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
bool myWaitingForFire
This flag is set to true when the controller pulls the trigger; it won't do anything in the tick func...
Definition: ballisticGunController.h:303
bool myOutOfAmmoWarn
Flag so an out-of-ammo warning is only sent once per target.
Definition: ballisticGunController.h:306
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
Definition: readerWriterRegistry.h:39
DtOutputPortGroup is a data port group of a data provider.
Definition: outputPortGroup.h:30
DtBooleanInputPort * myWeaponsHoldInputPort
Input Port Name: weapons-hold Input Port Description: When true, all firing is disabled.
Definition: ballisticGunController.h:268
virtual bool init()
Calls setRadio()
This file contains the class declaration for the.
int myRoundsAvailable
The quantity of the current munition in the resources store.
Definition: ballisticGunController.h:286
virtual void enable()
Is this component enabled or not.
Instances of DtEntityListOutputPort are output ports through which data producers can send a list of ...
Definition: entListIOPort.h:43
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
DtBallisticGunController provides ammunition loading, unloading, and trigger inputs for use by a ball...
Definition: ballisticGunController.h:45
DtIntegerResource implements the required functions for a resource that can be measured by an integer...
Definition: integerResource.h:17
DtVrfBalGunPSR * myProcessState
Pointer to a process state repository used to store state data associated with this component...
Definition: ballisticGunController.h:293
virtual bool createPorts()
Called by init.
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:29
virtual bool createPortGroups()
Called by init.
DtSimMunition myCurrentMunition
The correct munition and fuze for our current target.
Definition: ballisticGunController.h:282
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtIntegerOutputPort * myQuantityOutputPort
Output Port Name: quantity Output Port Description: Sends the number of rounds to be fired with a sin...
Definition: ballisticGunController.h:241
DtDetonatorFuze myCurrentFuze
Definition: ballisticGunController.h:283
DtIntegerInputPort * myLosInputPort
Input Port Name: line-of-sight Input Port Description: Indicates the result of a line of sight calcul...
Definition: ballisticGunController.h:226
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
const DtBallisticGunControllerDescriptor * myGunDescriptor
Get ammo select tables from here.
Definition: ballisticGunController.h:296
DtSimMunition class.
Definition: simMunition.h:34
DtUUID myPreviousTarget
Maintain the target we had last tick (if any) to detect changes in target (which will kick off possib...
Definition: ballisticGunController.h:279
DtBallisticGunControllerDescriptor, descriptor for the DtBallisticGunController component.
Definition: ballisticGunControllerDescriptor.h:24
DtBooleanOutputPort * myLoadedPort
Output Port Name: loaded Output Port Description: True when the gun is loaded.
Definition: ballisticGunController.h:248
Class DtVrfBalGunPSR: Used to hold checkpointable state for the processes associated with ballistic g...
Definition: vrfBalGunPSR.h:38
Represents the interface between the DtTargetSelectionController and a weapon system.
Definition: weaponComponentInterface.h:21