23#include <matrix/vlTaitBryan.h>
24#include <matrix/vlVector.h>
26class DtBooleanInputPort;
27class DtBooleanOutputPort;
28class DtInputPortGroup;
34class DtDetonationEvent;
68 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
81 virtual bool init()
override;
88 virtual const char*
type()
const override;
95 virtual void tick()
override;
127 static DtSimComponent*
creator(
const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
128 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
196 const DtVector& shooterPosition,
const DtTaitBryan shooterOrienation,
DtFireResult& fireResult);
226 const DtVector& firingPosition,
const DtTaitBryan firingOrientation);
240 const DtTaitBryan firingOrientation,
const DtFireResult& fireResult, DtReal& detTime);
Ammunition loading time parameter definitions for VREngage.
Extends the DtBallisticGun class with joystick control capabilities.
Class representing ballistic projectiles in simulations.
Definition projectile.h:42
Ammunition manager for VREngage weapon systems.
Definition vreAmmunitionManager.h:31
Extended ballistic gun descriptor for VREngage weapon systems.
Definition vreBallisticGunDescriptor.h:34
bool myIsFiring
Flag indicating whether the weapon is currently firing.
Definition vreGunJoyActuator.h:408
virtual const DtSimResource * lookupMunitionResource(const DtEntityType &resource) const
Looks up a munition resource by entity type.
virtual void preFirstTickInit() override
Performs initialization before the first simulation tick.
virtual makVre::DtVreMessageResult handleFireInput(makVre::DtVreMessage *msg)
Handles fire input messages from external sources.
virtual int currentResourceCount() const
Gets the current ammunition resource count.
virtual makVrfEvents::DtDetonationEvent * createDetonationInteraction(const DtVector &firingPosition, const DtTaitBryan firingOrientation, const DtFireResult &fireResult, DtReal &detTime)
Creates a detonation event for interaction processing.
bool myPreviouslyEngaged
Flag tracking previous engagement state.
Definition vreGunJoyActuator.h:439
DtVreAmmunitionManager * myAmmunitionManager
Manager for ammunition resources.
Definition vreGunJoyActuator.h:394
virtual makVre::DtVreMessageResult handleWeaponGeometry(makVre::DtVreMessage *msg)
Handles weapon geometry messages for positioning.
virtual ~DtVreGunJoyActuator() override
Virtual destructor.
int myCurrentMunition
Index of the currently selected munition type.
Definition vreGunJoyActuator.h:411
DtVreBallisticGunDescriptor * myVreBallisticGunDescriptor
Cached pointer to the ballistic gun descriptor.
Definition vreGunJoyActuator.h:341
DtVreGunJoyActuator(const DtVreGunJoyActuator &orig)
Copy constructor (not implemented)
virtual void tick() override
Updates the actuator state each simulation frame.
const DtSimResource * findResource(DtEntityType resourceType) const
Finds a specific resource by type (const version)
DtInputPortGroup * myWeaponPortGroup
Port group for weapon control inputs.
Definition vreGunJoyActuator.h:350
virtual bool init() override
Initializes the gun joystick actuator.
double myReturnGunToCgfControlDuration
Duration before returning gun control to CGF.
Definition vreGunJoyActuator.h:459
bool myCommanderOverrideActive
Flag for commander override mode.
Definition vreGunJoyActuator.h:430
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.
DtSimResource * findResource(DtEntityType resourceType)
Finds a specific resource by type.
const DtVreGunJoyActuator & operator=(const DtVreGunJoyActuator &orig)
Assignment operator (not implemented)
DtBooleanInputPort * myFirePort
Input port for fire command.
Definition vreGunJoyActuator.h:353
virtual bool aimGun() override
Aims the gun based on joystick input ports.
std::vector< Munition > myMunitions
List of available munitions for this weapon.
Definition vreGunJoyActuator.h:405
DtBooleanInputPort * myPreviousWeaponPort
Input port for previous weapon selection.
Definition vreGunJoyActuator.h:359
virtual DtSimMunition * getMunitionFromResourceType(const DtEntityType &resourceType) const
Gets a munition object from a resource type.
bool myOverrideArtPartGeometry
Flag for overriding articulated part geometry.
Definition vreGunJoyActuator.h:424
virtual void initializeResource(const DtSimResource *resource)
Initializes a resource for use with this weapon.
DtBooleanOutputPort * myFiringPort
Output port for firing state.
Definition vreGunJoyActuator.h:362
virtual void getFireResult(const DtVector &shooterPosition, const DtTaitBryan shooterOrienation, DtFireResult &fireResult)
Calculates the result of firing the weapon.
virtual void decrementResource()
Decrements the ammunition resource count.
virtual bool createPorts() override
Creates the input and output ports for the actuator.
DtBooleanInputPort * myNextWeaponPort
Input port for next weapon selection.
Definition vreGunJoyActuator.h:356
virtual bool createPortGroups() override
Creates the port groups for weapon control.
DtVector myWorldFiringPosition
Current world position for firing the weapon.
Definition vreGunJoyActuator.h:414
virtual DtVreMessageResult handleCommanderOverride(DtVreMessage *msg)
Handles commander override message.
virtual void updateStateProperties()
Updates the state properties for the gun actuator.
makVre::DtAmmoLoadTimeList myAmmoLoadTimeList
List of ammunition load times.
Definition vreGunJoyActuator.h:347
virtual double getAmmoLoadTime(const DtEntityType &ammoType)
Gets the load time for a specific ammunition type.
void setCurrentMunition(int munition)
Sets the current munition type for the weapon.
DtVreGunJoyActuator()
Default constructor (not implemented)
virtual const char * type() const override
Gets the type identifier for this component.
virtual bool createFlyOutProjectile(const DtVector &shooterPosition, const DtTaitBryan shooterOrienation)
Creates a flyout projectile from the weapon.
DtVreGunJoyActuator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
DtTaitBryan myWorldFiringOrientation
Current world orientation for firing the weapon.
Definition vreGunJoyActuator.h:417
double myDisengageElapsedTime
Elapsed time since player disengaged from gunner role.
Definition vreGunJoyActuator.h:448
virtual void createDetonation(const DtVector &detonationPosition, const DtFireResult &fireResult)
Creates a detonation at the specified position.
virtual makVrfEvents::DtFireEvent * createFireInteraction(const DtVector &firingPosition, const DtTaitBryan firingOrientation)
Creates a fire event for interaction processing.
bool aimGunElevation()
Controls the elevation aspect of gun aiming.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
DtVreSimComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition vreSimComponent.h:54
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtRwTemplatedListPtr< DtAmmoLoadTime, true > DtAmmoLoadTimeList
List of ammunition loading time parameters.
Definition ammoLoadTime.h:142
const char DtVreGunJoyActuatorType[]
Type identifier for the VRE gun joystick actuator component.
Definition vreGunJoyActuator.h:44
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition vrfRemoteControlConnector.h:87
Structure containing the results of a firing action.
Definition vreGunJoyActuator.h:181
double rangeToTarget
Range to the target in meters.
Definition vreGunJoyActuator.h:183
DtDetonationResult result
Result of the detonation calculation.
Definition vreGunJoyActuator.h:182
DtSimObjectReference targetEntity
Reference to the targeted entity, if any.
Definition vreGunJoyActuator.h:184
Structure containing munition configuration and state.
Definition vreGunJoyActuator.h:398
DtSimMunition myMunition
The munition object with projectile characteristics.
Definition vreGunJoyActuator.h:399
double myLoadtime
Time required to load this munition type in seconds.
Definition vreGunJoyActuator.h:401
DtEntityType myResourceType
The entity type of the resource for this munition.
Definition vreGunJoyActuator.h:400
Defines the base class for all VREngage messages.
Base template class for VR-Engage simulation components.