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

Detailed Description

This class is responsible for processing SteamVR/OpenVR controller events and translating them into the common VR controller event format. It communicates with the OpenVR API to retrieve controller state information and dispatches controller events to registered event processors.

Note
This class is created automatically by the DtVirtualRealityDriver and is not intended to be instantiated directly by users.

#include <DtOpenVREventManager.h>

Inheritance diagram for makVrv::DtOpenVREventManager:
[legend]

Public Member Functions

virtual ~DtOpenVREventManager () override
 
- Public Member Functions inherited from makVrv::DtVirtualRealityEventManager
virtual ~DtVirtualRealityEventManager () override
 
virtual void addEventProcessorToFront (DtVirtualRealityEventProcessorInterface *processor)
 
virtual void addEventProcessorToBack (DtVirtualRealityEventProcessorInterface *processor)
 
virtual void removeEventProcessor (DtVirtualRealityEventProcessorInterface *processor)
 
virtual const EventProcessorListeventProccesorList () const
 
virtual EventProcessorListeventProccesorList ()
 
const ControllerStateMapcontrollerStateMap () const
 

Static Public Member Functions

static DtVirtualRealityEventManagerinstance (DtDe &de)
 
- Static Public Member Functions inherited from makVrv::DtVirtualRealityEventManager
static DtVirtualRealityEventManagerinstance (DtDe &de)
 

Protected Member Functions

 DtOpenVREventManager (DtDe &de)
 
virtual void processVrEvents () override
 
virtual void updateControllerState (DtVirtualRealityControllerState::ControllerId deviceId, DtVirtualRealityControllerState &state)
 
virtual DtVirtualRealityControllerState::Bitfield findDeviceType (DtVirtualRealityControllerState::ControllerId deviceId) const
 
- Protected Member Functions inherited from makVrv::DtVirtualRealityEventManager
 DtVirtualRealityEventManager (DtDe &de)
 
virtual void dispatchControllerEvent (DtVirtualRealityControllerEvent &event)
 
virtual void tick ()
 

Protected Attributes

vr::IVRSystem * myVrSystem
 
- Protected Attributes inherited from makVrv::DtVirtualRealityEventManager
DtDe & myDe
 
DtVirtualRealityDriver * myVrDriver
 
EventProcessorList myEventProcessors
 
ControllerStateMap myControllerStates
 

Private Member Functions

 DtOpenVREventManager ()
 

Additional Inherited Members

- Public Types inherited from makVrv::DtVirtualRealityEventManager
using ControllerStateMap = std::map<unsigned int, DtVirtualRealityControllerState*>
 

Constructor & Destructor Documentation

◆ DtOpenVREventManager() [1/2]

makVrv::DtOpenVREventManager::DtOpenVREventManager ( )
private

Unused default constructor.

Private constructor to prevent direct instantiation. Use the instance() method to get the singleton instance instead.

◆ ~DtOpenVREventManager()

virtual makVrv::DtOpenVREventManager::~DtOpenVREventManager ( )
overridevirtual

Virtual destructor.

Cleans up OpenVR event manager resources and releases connections to the OpenVR API.

◆ DtOpenVREventManager() [2/2]

makVrv::DtOpenVREventManager::DtOpenVREventManager ( DtDe & de)
protected

Constructor.

Parameters
deReference to the display engine

Initializes the OpenVR event manager with a reference to the display engine. This constructor is only called by the registerInstance method and should not be called directly.

References de().

Member Function Documentation

◆ instance()

static DtVirtualRealityEventManager & makVrv::DtOpenVREventManager::instance ( DtDe & de)
static

Gets the singleton instance of the OpenVR event manager.

Parameters
deReference to the display engine
Returns
Reference to the singleton instance
Exceptions
DtCorruptedStateif it is unable to get the instance

Returns the singleton instance of the OpenVR event manager, creating it if it doesn't already exist. This method is called by the VR driver during initialization.

References de(), and makVrv::DtVirtualRealityEventManager::DtVirtualRealityEventManager().

◆ processVrEvents()

virtual void makVrv::DtOpenVREventManager::processVrEvents ( )
overrideprotectedvirtual

Collects and dispatches events from the OpenVR system.

Polls the OpenVR API for controller state updates, processes button and analog input events, and dispatches them to registered event processors.

Note
This method is called by the DtVirtualRealityDriver during the update cycle and is not intended to be called directly by users.

Implements makVrv::DtVirtualRealityEventManager.

◆ updateControllerState()

virtual void makVrv::DtOpenVREventManager::updateControllerState ( DtVirtualRealityControllerState::ControllerId deviceId,
DtVirtualRealityControllerState & state )
protectedvirtual

Updates controller state for a specific controller.

Parameters
deviceIdThe controller identifier to update
stateReference to the controller state to update

Updates the provided controller state object with the latest data from the OpenVR controller with the specified device ID. This includes position, orientation, button states, and analog input values.

◆ findDeviceType()

virtual DtVirtualRealityControllerState::Bitfield makVrv::DtOpenVREventManager::findDeviceType ( DtVirtualRealityControllerState::ControllerId deviceId) const
protectedvirtual

Determines the device type for a given controller ID.

Parameters
deviceIdThe controller identifier to query
Returns
Bitfield representing the device type

Maps an OpenVR-specific device identifier to the common controller device type enumeration used throughout the application.

Member Data Documentation

◆ myVrSystem

vr::IVRSystem* makVrv::DtOpenVREventManager::myVrSystem
protected

Pointer to the OpenVR system interface.

This pointer is used to communicate with the OpenVR API for retrieving controller state information and processing events.


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