13 #include <vl/fireInteraction.h>
14 #include <vl/detonationInteraction.h>
16 #include <vl/hostStructs.h>
30 #define DEBUG_MUZZLE_POSITION 0
69 virtual void initPendingDetonations();
73 virtual const char*
type()
const;
90 virtual void fire(
int roundsToFire,
bool computePHit);
103 virtual bool checkHitProbability(
const DtEntityType& type, DtReal
104 range,
int burstSize = 1);
108 virtual double hitProbabilityModifier(
const DtEntityType& type,
109 DtReal range,
int burstSize = 1);
114 virtual double targetMotionHitModifier(
const DtEntityType& type, DtReal
119 virtual double selfMotionHitModifier(
const DtEntityType& type, DtReal
124 virtual double skillLevelModifier(
const double range);
129 virtual double lifeformPostureModifier();
134 virtual double burstSizeModifier(
int burstSize);
143 virtual DtFireInteraction * createFireInteraction(
const int rounds);
167 DtTime& detTime,
bool& isHit,
168 bool assureMiss =
false);
178 virtual void getMissLocation(
DtVector gunPosition,
181 DtDetonationResult& detonationResult,
201 virtual DtString probabilityString()
const;
204 virtual DtVector calculateMuzzlePosition()
const;
221 virtual double maxGunRange()
const;
223 #if DEBUG_MUZZLE_POSITION
236 static void detonationCallback(
DtTimer * timer);
242 static void setTracerUseCallback(
DtSimMessage * msg,
void *component);
256 static void objectAddedCb(
const DtVrfObject * vrfObject,
void * usr);
271 virtual bool createPSR();
277 virtual void processObjectAdded(
const DtVrfObject * vrfObject);
280 virtual void addRangeItems();
285 virtual bool aimGun();
292 virtual DtEntityType munitionType(
DtSimMunition& munitionEntry);
294 #if DEBUG_MUZZLE_POSITION
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtAnalogInputPort * myAimElevationInputPort
Input Port Name: aim-elevation Input Port Description: Elevation at which to aim, in radians...
Definition: ballisticGun.h:379
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Instances of DtTimer are used to maintain the information needed to represent some kind of scheduled ...
Definition: timer.h:45
virtual bool taskVisualizationsActive() const
Returns true if task visualizations are currently active for this component.
const DtActuatorComponent & operator=(const DtActuatorComponent &orig)
assignment operator
const DtVrfObject * myCurrentTarget
These are set by createFireInteraction and used by createDetonationInteraction.
Definition: ballisticGun.h:322
DtReal myMuzzleSpeed
Definition: ballisticGun.h:317
DtVector myMuzzleOffset
Definition: ballisticGun.h:318
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtVrfBalGunPSR * myProcessState
Container for state data associated with this component.
Definition: ballisticGun.h:331
virtual bool init()
Overridden to cache a pointer to the entity's radio in this class.
DtBallisticGun provides a simple model of a ballistic gun.
Definition: ballisticGun.h:44
DtReal myMaxGunRange
This max gun range is determined by the P(hit) tables.
Definition: ballisticGun.h:315
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
DtBooleanInputPort * myLoadedPort
Input Port Name: loaded Input Port Description: Must be True for gun to fire.
Definition: ballisticGun.h:363
Description: This repository holds all information that is common to all the forms of all entity/aggr...
Definition: vrfObjectStateRepository.h:87
This file contains the class declaration for the.
End User Description: DtActuator is the base class for all actuator model components.
Definition: actuatorComponent.h:48
DtBallisticGunDescriptor; a descriptor for the DtBallisticGun component.
Definition: ballisticGunDescriptor.h:36
DtArtPartType myGunArtPart
Definition: ballisticGun.h:327
DtIntegerInputPort * myQuantityInputPort
Input Port Name: quantity Input Port Description: Indicates the number of rounds to be fired with a s...
Definition: ballisticGun.h:356
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:485
DtEventId myCurrentEventId
Definition: ballisticGun.h:323
class DtDetonationDescriptor:
Definition: detonationDescriptor.h:33
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
DtDetonationPdu DtDetonationInteraction
Definition: DistributedSimulationDriver3A.h:14
virtual bool createPorts()
Called by init.
DtList myTimerList
Definition: ballisticGun.h:326
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtInputPortGroup * myBalGunControlPortGroup
Input Port Group Name: gun-control Input Port Group Description:
Definition: ballisticGun.h:338
DtReal myCurrentRange
Definition: ballisticGun.h:324
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
DtBallisticGunDescriptor * myBalGunDescriptor
Definition: ballisticGun.h:310
DtBooleanInputPort * myTriggerPort
Input Port Name: trigger Input Port Description: Edge-triggered input which fires a round whenever a ...
Definition: ballisticGun.h:346
DtSimMunition class.
Definition: simMunition.h:34
Class DtVrfBalGunPSR: Used to hold checkpointable state for the processes associated with ballistic g...
Definition: vrfBalGunPSR.h:38
virtual const char * type() const =0
Returns a string identifies the class type of component.
DtIntegerInputPort * myLosPort
Input Port Name: line-of-sight Input Port Description: Indicates the result of a line of sight calcul...
Definition: ballisticGun.h:373