|
VR-Engage
2.2
|
This class represents a snapshot of all controller states at the moment an event occurred in the VR system. It provides access to the position, orientation, button states, and analog input values for all connected controllers. Event handlers can use this information to determine what actions to take in response to user input.
#include <DtVirtualRealityControllerEvent.h>
Public Types | |
| using | ControllerStateMap = std::map<unsigned int, DtVirtualRealityControllerState*> |
Public Member Functions | |
| DtVirtualRealityControllerEvent (const ControllerStateMap &controllerStates) | |
| virtual | ~DtVirtualRealityControllerEvent () |
| DtVirtualRealityControllerEvent (const DtVirtualRealityControllerEvent &orig) | |
| DtVirtualRealityControllerEvent & | operator= (const DtVirtualRealityControllerEvent &rhs) |
| virtual const ControllerStateMap & | controllerStates () const |
Protected Attributes | |
| ControllerStateMap | myControllerStates |
| using makVrv::DtVirtualRealityControllerEvent::ControllerStateMap = std::map<unsigned int, DtVirtualRealityControllerState*> |
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.
| makVrv::DtVirtualRealityControllerEvent::DtVirtualRealityControllerEvent | ( | const ControllerStateMap & | controllerStates | ) |
Constructor.
| controllerStates | Map of controller states at the time of the event |
Initializes a new controller event with a map of controller states. The constructor makes deep copies of all controller state objects to ensure the event represents an immutable snapshot in time.
References controllerStates().
Referenced by DtVirtualRealityControllerEvent(), and operator=().
|
virtual |
Virtual destructor.
Cleans up all controller state objects owned by this event. Since this class takes ownership of the controller state objects it contains, it's responsible for deleting them when destroyed.
| makVrv::DtVirtualRealityControllerEvent::DtVirtualRealityControllerEvent | ( | const DtVirtualRealityControllerEvent & | orig | ) |
Copy constructor.
| orig | The event to copy |
Creates a new controller event that is a deep copy of the original. This ensures that each event instance has its own independent set of controller state objects.
References DtVirtualRealityControllerEvent().
| DtVirtualRealityControllerEvent & makVrv::DtVirtualRealityControllerEvent::operator= | ( | const DtVirtualRealityControllerEvent & | rhs | ) |
Assignment operator.
| rhs | The event to copy |
Assigns the contents of another controller event to this one, performing a deep copy of all controller state objects.
References DtVirtualRealityControllerEvent().
|
virtual |
Gets the controller states at the time this event occurred.
Returns a read-only reference to the map of controller states that were captured when this event occurred. The map associates controller IDs with their corresponding state objects.
Referenced by DtVirtualRealityControllerEvent().
|
protected |
Map of controller states at the time of the event.
This map contains the state of all controllers at the time the event occurred. Each entry associates a controller ID with a pointer to a controller state object that this class owns and will delete.