|
VR-Engage
2.2
|
DtVreHumanHandWeaponSwitchController manages the enabling and disabling of secondary weapons on human entities. Due to handling limitations in the current version of VRF with multiple weapons, this controller disables secondary weapons when VRF is in control of the entity and enables them when VR Engage is in control.
This ensures proper weapon handling while maintaining compatibility between VRF and VR Engage control modes.
#include <humanHandWeaponSwitchController.h>
Public Member Functions | |
| DtVreHumanHandWeaponSwitchController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual void | preFirstTickInit () override |
| virtual | ~DtVreHumanHandWeaponSwitchController () override |
| virtual void | tick () override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtVreSimComponent< DtSimComponent > | |
| DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtVreSimComponent () |
| bool | isPlayerControlled (const std::string &role="") const |
| DtString | entitySystemName () const |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry) |
Protected Member Functions | |
| void | collectHandheldWeaponSystems () |
Protected Attributes | |
| std::vector< DtComponentSystem * > | mySystemList |
| bool | myWasPlayerControlled |
Private Member Functions | |
| DtVreHumanHandWeaponSwitchController () | |
| DtVreHumanHandWeaponSwitchController (const DtVreHumanHandWeaponSwitchController &orig) | |
| const DtVreHumanHandWeaponSwitchController & | operator= (const DtVreHumanHandWeaponSwitchController &orig) |
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
Referenced by DtVreHumanHandWeaponSwitchController(), and operator=().
|
private |
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtVreHumanHandWeaponSwitchController().
| makVre::DtVreHumanHandWeaponSwitchController::DtVreHumanHandWeaponSwitchController | ( | const DtString & | name, |
| DtLocalObject * | owner, | ||
| DtSimulationServices * | simManager, | ||
| DtComponentDescriptor * | desc = 0, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
| name | The name of this component |
| owner | The local object that owns this component |
| simManager | The simulation services manager |
| desc | Optional component descriptor |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new human handheld weapon switch controller component with the specified parameters.
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the human handheld weapon switch controller component.
|
private |
Assignment operator (not implemented)
Assignment operator is private and not implemented to prevent assignment.
References DtVreHumanHandWeaponSwitchController().
|
overridevirtual |
Initializes weapon system references before the first tick.
Identifies all weapon systems in the entity by checking for "aimable-weapon" in the system category. Excludes the first weapon system and stores references to any additional weapon systems found. These secondary weapons will be managed based on control state changes.
|
overridevirtual |
Updates weapon system states each simulation frame.
Checks whether the entity is player-controlled each frame. When control state changes, enables or disables secondary weapon systems accordingly. Secondary weapons are enabled when under VR Engage control and disabled when under VRF control.
|
overridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
|
static |
Factory method to create a new instance of this component.
| name | The name for the new component |
| owner | The local object that will own this component |
| simManager | The simulation services manager |
| desc | Component descriptor with configuration parameters |
| parentRegistry | Optional parent registry for reader/writer functionality |
Static factory method used by the component creation system to instantiate new instances of this component type.
|
protected |
Collects references to secondary weapon systems.
Scans through all component systems in the entity and identifies those with the "aimable-weapon" category. Excludes the first weapon system found (primary weapon) and adds any others to mySystemList for management. In most cases, the secondary weapon will be a pistol or other sidearm.
|
protected |
List of secondary weapon systems to be managed.
Contains pointers to all secondary weapon systems (all but the first) that have the "aimable-weapon" category.
|
protected |
Previous player control state.
Tracks whether the entity was player-controlled in the previous frame, used to detect transitions between control states.