VR-Engage  2.2
Loading...
Searching...
No Matches
DtVirtualRealityControllerEvent.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file DtVirtualRealityControllerEvent.h
7//! \brief Defines a class that encapsulates VR controller events
8//! \ingroup vrvVirtualRealityController
9//!
10//! This file contains the definition of the DtVirtualRealityControllerEvent class,
11//! which encapsulates the state of all VR controllers at a specific point in time
12//! when an event occurred. This provides a snapshot of controller positions, orientations,
13//! and input states that can be processed by event handlers.
14
15#pragma once
16
19
20namespace makVrv
21{
22//! \brief Encapsulates a virtual reality controller event
23//!
24//! This class represents a snapshot of all controller states at the moment
25//! an event occurred in the VR system. It provides access to the position,
26//! orientation, button states, and analog input values for all connected
27//! controllers. Event handlers can use this information to determine what
28//! actions to take in response to user input.
29class DT_DLL_VRVVRCTLR DtVirtualRealityControllerEvent
30{
31public:
32 //! \brief Map type that associates controller IDs with their state objects
33 //!
34 //! This map associates controller identifiers (unsigned integers) with
35 //! pointers to controller state objects that contain the controller's
36 //! position, orientation, and input states.
37 using ControllerStateMap = std::map<unsigned int, DtVirtualRealityControllerState*>;
38
39 //! \brief Constructor
40 //! \param controllerStates Map of controller states at the time of the event
41 //!
42 //! Initializes a new controller event with a map of controller states.
43 //! The constructor makes deep copies of all controller state objects
44 //! to ensure the event represents an immutable snapshot in time.
46
47 //! \brief Virtual destructor
48 //!
49 //! Cleans up all controller state objects owned by this event.
50 //! Since this class takes ownership of the controller state objects
51 //! it contains, it's responsible for deleting them when destroyed.
53
54 //! \brief Copy constructor
55 //! \param orig The event to copy
56 //!
57 //! Creates a new controller event that is a deep copy of the original.
58 //! This ensures that each event instance has its own independent set
59 //! of controller state objects.
61
62 //! \brief Assignment operator
63 //! \param rhs The event to copy
64 //! \return Reference to this object after assignment
65 //!
66 //! Assigns the contents of another controller event to this one,
67 //! performing a deep copy of all controller state objects.
69
70 //! \brief Gets the controller states at the time this event occurred
71 //! \return Constant reference to the map of controller states
72 //!
73 //! Returns a read-only reference to the map of controller states that were
74 //! captured when this event occurred. The map associates controller IDs with
75 //! their corresponding state objects.
76 virtual const ControllerStateMap& controllerStates() const;
77
78protected:
79 //! \brief Map of controller states at the time of the event
80 //!
81 //! This map contains the state of all controllers at the time the event
82 //! occurred. Each entry associates a controller ID with a pointer to a
83 //! controller state object that this class owns and will delete.
85};
86} // namespace makVrv
Defines a class that encapsulates the state of a VR controller.
virtual const ControllerStateMap & controllerStates() const
Gets the controller states at the time this event occurred.
std::map< unsigned int, DtVirtualRealityControllerState * > ControllerStateMap
Map type that associates controller IDs with their state objects.
Definition DtVirtualRealityControllerEvent.h:37
DtVirtualRealityControllerEvent(const DtVirtualRealityControllerEvent &orig)
Copy constructor.
virtual ~DtVirtualRealityControllerEvent()
Virtual destructor.
ControllerStateMap myControllerStates
Map of controller states at the time of the event.
Definition DtVirtualRealityControllerEvent.h:84
DtVirtualRealityControllerEvent & operator=(const DtVirtualRealityControllerEvent &rhs)
Assignment operator.
DtVirtualRealityControllerEvent(const ControllerStateMap &controllerStates)
Constructor.
Definition appLauncherComponent.h:28
Main header file for the VRV Virtual Reality Controller module.