VR-Engage  2.2
Loading...
Searching...
No Matches
makVrv::DtVirtualRealityEventManager Class Referenceabstract

Detailed Description

This abstract base class defines the interface and common functionality for VR controller event management. It maintains the current state of all connected controllers, processes events from the VR system, and dispatches these events to registered event processors.

Specific VR platforms (Oculus, OpenVR, etc.) implement derived classes that handle the platform-specific details of retrieving controller state information.

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

#include <DtVirtualRealityEventManager.h>

Inheritance diagram for makVrv::DtVirtualRealityEventManager:
[legend]

Public Types

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

Public Member Functions

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)
 

Protected Member Functions

 DtVirtualRealityEventManager (DtDe &de)
 
virtual void dispatchControllerEvent (DtVirtualRealityControllerEvent &event)
 
virtual void tick ()
 
virtual void processVrEvents ()=0
 

Protected Attributes

DtDe & myDe
 
DtVirtualRealityDriver * myVrDriver
 
EventProcessorList myEventProcessors
 
ControllerStateMap myControllerStates
 

Private Member Functions

 DtVirtualRealityEventManager ()
 

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

◆ DtVirtualRealityEventManager() [1/2]

makVrv::DtVirtualRealityEventManager::DtVirtualRealityEventManager ( )
private

Unused default constructor.

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

Referenced by makVrv::DtOculusEventManager::instance(), makVrv::DtOpenVREventManager::instance(), and instance().

◆ ~DtVirtualRealityEventManager()

virtual makVrv::DtVirtualRealityEventManager::~DtVirtualRealityEventManager ( )
overridevirtual

Virtual destructor.

Cleans up event manager resources, including all registered event processors and controller state objects.

◆ DtVirtualRealityEventManager() [2/2]

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

CTOR.

References de().

Member Function Documentation

◆ instance()

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

Gets the singleton instance of the appropriate 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 appropriate VR event manager for the current VR system (e.g., Oculus, OpenVR), creating it if it doesn't already exist. This method is called by the VR driver during initialization.

References de(), and DtVirtualRealityEventManager().

◆ addEventProcessorToFront()

virtual void makVrv::DtVirtualRealityEventManager::addEventProcessorToFront ( DtVirtualRealityEventProcessorInterface * processor)
virtual

Registers an event processor at the front of the event processing queue.

Parameters
processorPointer to the event processor to register

Adds the specified event processor to the front of the event processing queue. Event processors at the front of the queue receive events before those at the back. This is useful when an event processor needs to handle events before others, potentially intercepting and canceling events for other processors.

◆ addEventProcessorToBack()

virtual void makVrv::DtVirtualRealityEventManager::addEventProcessorToBack ( DtVirtualRealityEventProcessorInterface * processor)
virtual

Registers an event processor at the back of the event processing queue.

Parameters
processorPointer to the event processor to register

Adds the specified event processor to the back of the event processing queue. Event processors at the back of the queue receive events after those at the front. This is the default and most common way to register event processors.

◆ removeEventProcessor()

virtual void makVrv::DtVirtualRealityEventManager::removeEventProcessor ( DtVirtualRealityEventProcessorInterface * processor)
virtual

Unregisters an event processor.

Parameters
processorPointer to the event processor to unregister

Removes the specified event processor from the event processing queue. After removal, the processor will no longer receive controller events. If the processor is not in the queue, this method has no effect.

◆ eventProccesorList() [1/2]

virtual const EventProcessorList & makVrv::DtVirtualRealityEventManager::eventProccesorList ( ) const
virtual

const access the event processor list

◆ eventProccesorList() [2/2]

virtual EventProcessorList & makVrv::DtVirtualRealityEventManager::eventProccesorList ( )
virtual

non-const access to the event processor list

◆ controllerStateMap()

const ControllerStateMap & makVrv::DtVirtualRealityEventManager::controllerStateMap ( ) const

Access the Controller State map containing the most recent state of all controllers. Map is indexed by controller id.

◆ dispatchControllerEvent()

virtual void makVrv::DtVirtualRealityEventManager::dispatchControllerEvent ( DtVirtualRealityControllerEvent & event)
protectedvirtual

dispatch controller event to any active event handlers

◆ tick()

virtual void makVrv::DtVirtualRealityEventManager::tick ( )
protectedvirtual

called every frame by the system. Calls the processVREvents for the specific system

◆ processVrEvents()

virtual void makVrv::DtVirtualRealityEventManager::processVrEvents ( )
protectedpure virtual

collects and dispatches events from the VR system to any active event processors.

Implemented in makVrv::DtOculusEventManager, and makVrv::DtOpenVREventManager.

Member Data Documentation

◆ myDe

DtDe& makVrv::DtVirtualRealityEventManager::myDe
protected

◆ myVrDriver

DtVirtualRealityDriver* makVrv::DtVirtualRealityEventManager::myVrDriver
protected

◆ myEventProcessors

EventProcessorList makVrv::DtVirtualRealityEventManager::myEventProcessors
protected

◆ myControllerStates

ControllerStateMap makVrv::DtVirtualRealityEventManager::myControllerStates
protected

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