|
VR-Engage
2.2
|
This class provides a common interface for all input devices (gamepad, joystick, keyboard, etc.). Instances are owned by a DtVreInputManager. Derived classes receive input from specific hardware device APIs, map these inputs to DtInputData structures, and then call processInput() in the DtVreInputManager to handle the input events.
#include <inputDevice.h>
Public Member Functions | |
| DtInputDevice () | |
| virtual | ~DtInputDevice () |
| DtInputDevice (const DtInputDevice &mapping)=delete | |
| DtInputDevice & | operator= (const DtInputDevice &)=delete |
| virtual bool | init (DtVreInputManager &mgr)=0 |
| virtual void | tick (double dt)=0 |
| virtual void | shutdown ()=0 |
| virtual void | reportCurrentState ()=0 |
Protected Attributes | |
| DtVreInputManager * | myManager |
|
inline |
Default constructor.
Referenced by DtInputDevice(), and operator=().
|
inlinevirtual |
Virtual destructor.
|
delete |
Copy constructor (deleted)
Input devices cannot be copied due to hardware abstraction requirements
References DtInputDevice().
|
delete |
Assignment operator (deleted)
Input devices cannot be assigned due to hardware abstraction requirements
References DtInputDevice().
|
pure virtual |
Initialize the device with a reference to the input manager.
Sets up the device and prepares it to receive input events from hardware.
| mgr | Reference to the input manager that owns this device |
Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.
|
pure virtual |
Update method called each frame by the input manager.
Allows the device to poll for input, handle timing-related events, and perform any per-frame processing needed.
| dt | Delta time in seconds since the last frame |
Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.
|
pure virtual |
Shutdown the device and release hardware resources.
Disconnects from the hardware device and stops receiving input events. Should clean up any resources allocated during initialization.
Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.
|
pure virtual |
Report the current state of all buttons, axes, and other inputs.
Sends input events for the current state of all device controls without requiring actual hardware input. Useful for initializing the system with the current device state or for testing.
Implemented in DtQmlGamepadInputDevice, makVre::DtSDLGameControllerDevice, and makVre::DtVrvKeyboardMouseDevice.
|
protected |
Pointer to the input manager that owns this device.
Used to send input events to the manager for processing