VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreAimWeaponController Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtVreAimWeaponController:
[legend]

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 DtVreAimWeaponControlleroperator= (const DtVreAimWeaponController &orig)
 

Constructor & Destructor Documentation

◆ DtVreAimWeaponController() [1/3]

makVre::DtVreAimWeaponController::DtVreAimWeaponController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descComponent descriptor with configuration parameters
parentRegistryOptional parent registry for reader/writer functionality

Creates a new aim weapon controller component with the specified parameters.

Referenced by DtVreAimWeaponController(), and operator=().

◆ ~DtVreAimWeaponController()

virtual makVre::DtVreAimWeaponController::~DtVreAimWeaponController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the aim weapon controller component.

◆ DtVreAimWeaponController() [2/3]

makVre::DtVreAimWeaponController::DtVreAimWeaponController ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

◆ DtVreAimWeaponController() [3/3]

makVre::DtVreAimWeaponController::DtVreAimWeaponController ( const DtVreAimWeaponController & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtVreAimWeaponController().

Member Function Documentation

◆ type()

virtual const char * makVre::DtVreAimWeaponController::type ( ) const
inlineoverridevirtual

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreAimWeaponControllerType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

References makVre::DtVreAimWeaponControllerType.

◆ tick()

virtual void makVre::DtVreAimWeaponController::tick ( )
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:

  • Checks if player is acting in the gunner role for this entity. If so, returns immediately.
  • Contains a fix for yaw aiming using VR controllers.
  • Allow aiming the entity itself even if it does not have a weapon to aim.

◆ creator()

static DtSimComponent * makVre::DtVreAimWeaponController::creator ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )
static

Factory method to create a new instance of this component.

Parameters
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional parent registry for reader/writer functionality
Returns
Pointer to the newly created component

Static factory method used by the component creation system to instantiate new instances of this component type.

◆ getGunPart()

virtual makVrf::DtArticulatedPartStateRepository * makVre::DtVreAimWeaponController::getGunPart ( )
protectedvirtual

Retrieves the articulated part state repository for the gun.

Returns
Pointer to 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.

◆ operator=()

const DtVreAimWeaponController & makVre::DtVreAimWeaponController::operator= ( const DtVreAimWeaponController & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtVreAimWeaponController().


The documentation for this class was generated from the following file: