|
VR-Engage
2.2
|
DtVreAimWeaponController is responsible for controlling the aiming of a weapon at a specified target point. It manages the articulated parts of the weapon to ensure proper orientation toward the target. This controller supports both AI-controlled and player-controlled aiming, with special handling for VR input. It also provides functionality for aiming the entity itself when it doesn't have a specific weapon to aim.
Uses Descriptor Type: DtAimWeaponControllerDescriptor
#include <vreAimWeaponController.h>
Public Member Functions | |
| DtVreAimWeaponController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtVreAimWeaponController () override |
| virtual const char * | type () const override |
| virtual void | tick () override |
Public Member Functions inherited from makVre::DtVreSimComponent< DtAimWeaponController > | |
| 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=0, DtReaderWriterRegistry *parentRegistry=0) |
Protected Member Functions | |
| virtual makVrf::DtArticulatedPartStateRepository * | getGunPart () |
Private Member Functions | |
| DtVreAimWeaponController () | |
| DtVreAimWeaponController (const DtVreAimWeaponController &orig) | |
| const DtVreAimWeaponController & | operator= (const DtVreAimWeaponController &orig) |
| makVre::DtVreAimWeaponController::DtVreAimWeaponController | ( | 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 | Component descriptor with configuration parameters |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new aim weapon controller component with the specified parameters.
Referenced by DtVreAimWeaponController(), and operator=().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the aim weapon controller component.
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
|
private |
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtVreAimWeaponController().
|
inlineoverridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
References makVre::DtVreAimWeaponControllerType.
|
overridevirtual |
Updates the weapon aiming each simulation frame.
Controls the aiming of the weapon toward its target point. If a player is acting in the gunner role for this entity, the function returns immediately to allow player control. Otherwise, it performs AI-controlled aiming with additional handling for VR controller input. This override also allows aiming the entity itself even when it doesn't have a dedicated weapon to aim. Overridden for the following:
|
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 | Optional component descriptor |
| 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.
|
protectedvirtual |
Retrieves the articulated part state repository for the gun.
Gets the articulated part state repository that represents the gun part that this controller is responsible for aiming. This method is used internally to access the part for applying rotation and aiming adjustments.
|
private |
Assignment operator (not implemented)
Assignment operator is private and not implemented to prevent assignment.
References DtVreAimWeaponController().