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