21#include <vrfobjcore/simObjectReference.h>
23class DtBooleanInputPort;
24class DtBooleanOutputPort;
25class DtInputPortGroup;
36class DtDetonationEvent;
82 DtVreGunActuator(
const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
83 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
97 virtual bool init()
override;
104 virtual const char*
type()
const override;
130 static DtSimComponent*
creator(
const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
131 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
174 const DtVector& shooterPosition,
const DtTaitBryan shooterOrienation,
DtFireResult& fireResult);
184 const DtVector& firingPosition,
const DtTaitBryan firingOrientation);
198 const DtTaitBryan firingOrientation,
const DtFireResult& fireResult, DtReal& detTime);
Extends the DtBallisticGun class with joystick control capabilities.
Gun actuator descriptor for VREngage weapon systems.
Definition vreGunActuatorDescriptor.h:33
std::string myRangeName
Name of the range parameter for configuration.
Definition vreGunActuator.h:289
double myUnloadTime
Time required to unload the weapon in seconds.
Definition vreGunActuator.h:283
virtual bool init() override
Initializes the gun actuator.
int myRoundsPerDetonation
Number of rounds consumed per detonation event.
Definition vreGunActuator.h:292
int myRoundsPerMagazine
Number of rounds per magazine for ammunition management.
Definition vreGunActuator.h:271
double myRange
Maximum effective range of the weapon in meters.
Definition vreGunActuator.h:286
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Factory method to create a new instance of this component.
virtual void preFirstTickInit() override
Performs initialization before the first simulation tick.
DtVreGunActuator(const DtVreGunActuator &orig)
Copy constructor (not implemented)
int myCurrentMunition
Index of the currently selected munition type.
Definition vreGunActuator.h:262
virtual makVrfEvents::DtDetonationEvent * createDetonationInteraction(const DtVector &firingPosition, const DtTaitBryan firingOrientation, const DtFireResult &fireResult, DtReal &detTime)
Creates a detonation event for interaction processing.
DtString myCurrentEventId
Current event ID for tracking interaction events.
Definition vreGunActuator.h:320
DtInputPortGroup * myWeaponPortGroup
Port group for weapon control inputs.
Definition vreGunActuator.h:244
virtual void scheduleDetonation(makVrfEvents::DtDetonationEvent *detInter, DtTime detTime)
Schedules a detonation event to occur at a specific time.
virtual void tick() override
Updates the actuator state each simulation frame.
DtVrfBalGunPSR * myProcessState
Process state repository for preserving state data.
Definition vreGunActuator.h:307
double myMuzzleSpeed
Muzzle velocity of fired projectiles in meters per second.
Definition vreGunActuator.h:268
DtVreGunActuatorDescriptor * myGunDescriptor
Pointer to the gun actuator descriptor with configuration parameters.
Definition vreGunActuator.h:310
DtBooleanInputPort * myPreviousWeaponPort
Input port for previous weapon selection.
Definition vreGunActuator.h:253
virtual const char * type() const override
Gets the type identifier for this component.
DtSimObjectReference myCurrentTarget
Reference to the current target entity.
Definition vreGunActuator.h:315
DtBooleanInputPort * myNextWeaponPort
Input port for next weapon selection.
Definition vreGunActuator.h:250
DtBooleanInputPort * myFirePort
Input port for fire command.
Definition vreGunActuator.h:247
const DtVreGunActuator & operator=(const DtVreGunActuator &orig)
Assignment operator (not implemented)
bool myReportedNoArticulation
Flag indicating whether a missing articulation warning has been reported.
Definition vreGunActuator.h:301
virtual ~DtVreGunActuator() override
Virtual destructor.
void setCurrentMunition(int munition)
Sets the current munition type for the weapon.
DtVreGunActuator()
Default constructor (not implemented)
DtBooleanOutputPort * myFiringPort
Output port for firing state.
Definition vreGunActuator.h:256
virtual bool createPSR()
Creates the process state repository for the actuator.
static void detonationCallback(DtTimer *timer)
Callback function for detonation timers.
virtual bool createPortGroups() override
Creates the port groups for weapon control.
int myRoundsPerMinute
Rate of fire in rounds per minute.
Definition vreGunActuator.h:274
DtVreGunActuator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual void getFireResult(const DtVector &shooterPosition, const DtTaitBryan shooterOrienation, DtFireResult &fireResult)
Calculates the result of firing the weapon.
DtList myTimerList
List of active detonation timers.
Definition vreGunActuator.h:298
int myAttachedPart
Part ID of the articulated part the weapon is attached to.
Definition vreGunActuator.h:265
DtReal myCurrentRange
Current range to target in meters.
Definition vreGunActuator.h:325
DtSimResource * findResource(DtEntityType resourceType)
Finds a specific resource by type.
virtual void decrementResource()
Decrements the ammunition resource count.
DtVector calculateMuzzlePosition()
Calculates the current muzzle position in world coordinates.
std::vector< DtEntityType > myMunitionList
List of available munition types for this weapon.
Definition vreGunActuator.h:295
virtual bool createPorts() override
Creates the input and output ports for the actuator.
double myLoadTime
Time required to load the weapon in seconds.
Definition vreGunActuator.h:280
DtVector myMuzzleOffset
Offset vector from entity origin to muzzle position.
Definition vreGunActuator.h:277
bool myIsFiring
Flag indicating whether the weapon is currently firing.
Definition vreGunActuator.h:259
virtual makVrfEvents::DtFireEvent * createFireInteraction(const DtVector &firingPosition, const DtTaitBryan firingOrientation)
Creates a fire event for interaction processing.
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Definition vrfRemoteControlConnector.h:87
Structure containing the results of a firing action.
Definition vreGunActuator.h:159
DtSimObjectReference targetEntity
Reference to the targeted entity, if any.
Definition vreGunActuator.h:162
DtDetonationResult result
Result of the detonation calculation.
Definition vreGunActuator.h:160
double rangeToTarget
Range to the target in meters.
Definition vreGunActuator.h:161
const char DtVreGunActuatorType[]
Type identifier for the VRE gun actuator component.
Definition vreGunActuator.h:28
const unsigned int DtVreGunDetonationTimerType
Timer type for gun detonation events.
Definition vreGunActuator.h:31
Defines the base class for all VREngage messages.