VR-Engage  2.2
Loading...
Searching...
No Matches
makVrv::DtVirtualRealityControllerEvent Class Reference

Detailed Description

This class represents a snapshot of all controller states at the moment an event occurred in the VR system. It provides access to the position, orientation, button states, and analog input values for all connected controllers. Event handlers can use this information to determine what actions to take in response to user input.

#include <DtVirtualRealityControllerEvent.h>

Public Types

using ControllerStateMap = std::map<unsigned int, DtVirtualRealityControllerState*>
 

Public Member Functions

 DtVirtualRealityControllerEvent (const ControllerStateMap &controllerStates)
 
virtual ~DtVirtualRealityControllerEvent ()
 
 DtVirtualRealityControllerEvent (const DtVirtualRealityControllerEvent &orig)
 
DtVirtualRealityControllerEventoperator= (const DtVirtualRealityControllerEvent &rhs)
 
virtual const ControllerStateMapcontrollerStates () const
 

Protected Attributes

ControllerStateMap myControllerStates
 

Member Typedef Documentation

◆ ControllerStateMap

Map type that associates controller IDs with their state objects.

This map associates controller identifiers (unsigned integers) with pointers to controller state objects that contain the controller's position, orientation, and input states.

Constructor & Destructor Documentation

◆ DtVirtualRealityControllerEvent() [1/2]

makVrv::DtVirtualRealityControllerEvent::DtVirtualRealityControllerEvent ( const ControllerStateMap & controllerStates)

Constructor.

Parameters
controllerStatesMap of controller states at the time of the event

Initializes a new controller event with a map of controller states. The constructor makes deep copies of all controller state objects to ensure the event represents an immutable snapshot in time.

References controllerStates().

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

◆ ~DtVirtualRealityControllerEvent()

virtual makVrv::DtVirtualRealityControllerEvent::~DtVirtualRealityControllerEvent ( )
virtual

Virtual destructor.

Cleans up all controller state objects owned by this event. Since this class takes ownership of the controller state objects it contains, it's responsible for deleting them when destroyed.

◆ DtVirtualRealityControllerEvent() [2/2]

makVrv::DtVirtualRealityControllerEvent::DtVirtualRealityControllerEvent ( const DtVirtualRealityControllerEvent & orig)

Copy constructor.

Parameters
origThe event to copy

Creates a new controller event that is a deep copy of the original. This ensures that each event instance has its own independent set of controller state objects.

References DtVirtualRealityControllerEvent().

Member Function Documentation

◆ operator=()

DtVirtualRealityControllerEvent & makVrv::DtVirtualRealityControllerEvent::operator= ( const DtVirtualRealityControllerEvent & rhs)

Assignment operator.

Parameters
rhsThe event to copy
Returns
Reference to this object after assignment

Assigns the contents of another controller event to this one, performing a deep copy of all controller state objects.

References DtVirtualRealityControllerEvent().

◆ controllerStates()

virtual const ControllerStateMap & makVrv::DtVirtualRealityControllerEvent::controllerStates ( ) const
virtual

Gets the controller states at the time this event occurred.

Returns
Constant reference to the map of controller states

Returns a read-only reference to the map of controller states that were captured when this event occurred. The map associates controller IDs with their corresponding state objects.

Referenced by DtVirtualRealityControllerEvent().

Member Data Documentation

◆ myControllerStates

ControllerStateMap makVrv::DtVirtualRealityControllerEvent::myControllerStates
protected

Map of controller states at the time of the event.

This map contains the state of all controllers at the time the event occurred. Each entry associates a controller ID with a pointer to a controller state object that this class owns and will delete.


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