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