VR-Engage  2.3
Loading...
Searching...
No Matches
DtOculusEventManager.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file DtOculusEventManager.h
7//! \brief Oculus-specific implementation of VR controller event management
8//!
9//! This file contains the Oculus-specific implementation of the virtual reality
10//! event manager. It handles processing of Oculus Touch controller inputs and
11//! translating them into a common VR controller event format used throughout
12//! the application.
13
14#pragma once
15
19
20#include "OVR_CAPI.h"
21
22namespace makVrv
23{
24//! \brief Oculus-specific implementation of the virtual reality event manager
25//!
26//! This class is responsible for processing Oculus Touch controller events and
27//! translating them into the common VR controller event format. It communicates
28//! with the Oculus SDK to retrieve controller state information and dispatches
29//! controller events to registered event processors.
30//!
31//! \note This class is created automatically by the DtVirtualRealityDriver
32//! and is not intended to be instantiated directly by users.
34{
35private:
36 //! \brief Unused default constructor
38
39public:
40 //! \brief Gets the singleton instance of the Oculus event manager
41 //! \param de Reference to the display engine
42 //! \return Reference to the singleton instance
43 //! \throws DtCorruptedState if it is unable to get the instance
44 //!
45 //! Returns the singleton instance of the Oculus event manager, creating it
46 //! if it doesn't already exist. This method is called by the VR driver
47 //! during initialization.
49
50 //! \brief Virtual destructor
51 //!
52 //! Cleans up Oculus event manager resources and releases connections
53 //! to the Oculus SDK.
54 virtual ~DtOculusEventManager() override;
55
56 // //! \brief get/set the deadzone for the given axis of the given controller.
57 // virtual DtVector2f deadZone(DtVirtualRealityControllerState::Controller,
58 // DtVirtualRealityControllerState::Axis) const; virtual void
59 // setDeadZone(DtVirtualRealityControllerState::Controller, DtVirtualRealityControllerState::Axis, const
60 // DtVector2f&);
61
62protected:
63 //! \brief Constructor
64 //! \param de Reference to the display engine
65 //!
66 //! Initializes the Oculus event manager with a reference to the display engine.
67 //! This constructor is only called by the registerInstance method and
68 //! should not be called directly.
70
71 //! \brief Collects and dispatches events from the Oculus VR system
72 //!
73 //! Polls the Oculus SDK for controller state updates, processes button and
74 //! analog input events, and dispatches them to registered event processors.
75 //!
76 //! \note This method is called by the DtVirtualRealityDriver during the
77 //! update cycle and is not intended to be called directly by users.
78 virtual void processVrEvents() override;
79
80 //! \brief Updates controller positions from Oculus tracking data
81 //! \param tracking The Oculus tracking state containing position and orientation data
82 //!
83 //! Processes the controller tracking data from the Oculus SDK and updates
84 //! the internal controller state with new position and orientation information.
85 virtual void updateControllerPositions(ovrTrackingState& tracking);
86
87 //! \brief Updates controller input states from Oculus input data
88 //! \param inputState The Oculus input state containing button and analog input data
89 //!
90 //! Processes the controller input data from the Oculus SDK and updates
91 //! the internal controller state with button presses, touches, and
92 //! analog input values.
93 virtual void updateControllerInputs(ovrInputState& inputState);
94
95 //! \brief Determines the device type for a given controller ID
96 //! \param deviceId The controller identifier to query
97 //! \return Bitfield representing the device type
98 //!
99 //! Maps an Oculus-specific device identifier to the common controller device
100 //! type enumeration used throughout the application.
103
104protected:
105};
106} // namespace makVrv
Defines a class that encapsulates the state of a VR controller.
Defines the base class for VR controller event management.
static DtVirtualRealityEventManager & instance(DtDe &de)
Gets the singleton instance of the Oculus event manager.
virtual void updateControllerInputs(ovrInputState &inputState)
Updates controller input states from Oculus input data.
virtual void updateControllerPositions(ovrTrackingState &tracking)
Updates controller positions from Oculus tracking data.
DtOculusEventManager(DtDe &de)
Constructor.
virtual void processVrEvents() override
Collects and dispatches events from the Oculus VR system.
virtual DtVirtualRealityControllerState::Bitfield findDeviceType(DtVirtualRealityControllerState::ControllerId deviceId) const
Determines the device type for a given controller ID.
DtOculusEventManager()
Unused default constructor.
virtual ~DtOculusEventManager() override
Virtual destructor.
unsigned long long Bitfield
Type used for bit flags throughout the class.
Definition DtVirtualRealityControllerState.h:40
unsigned int ControllerId
Type used for controller identification.
Definition DtVirtualRealityControllerState.h:45
DtVirtualRealityEventManager()
Unused default constructor.
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.
Main header file for the VRV Virtual Reality Controller module.