20#include <vrvUtil/DtQuat.h>
21#include <vrvMath/DtVector2.h>
23#include <matrix/vlVector.h>
virtual void setAxisPosition(AxisId axisId, const DtVector2f &value)
virtual bool controllerWasLost() const
DtVector2< float32 > DtVector2f
Type used for 2D vector values.
Definition DtVirtualRealityControllerState.h:52
static const ControllerId NoId
Special value indicating no controller ID.
Definition DtVirtualRealityControllerState.h:58
virtual void setButtonStates(Bitfield buttonStates)
ButtonId
Unique known button IDs; controller may have additional buttons.
Definition DtVirtualRealityControllerState.h:75
@ Button_Menu
Definition DtVirtualRealityControllerState.h:77
@ Button_B
Definition DtVirtualRealityControllerState.h:81
@ Button_Down
Definition DtVirtualRealityControllerState.h:86
@ Button_Trigger
Definition DtVirtualRealityControllerState.h:78
@ Button_Grip
Definition DtVirtualRealityControllerState.h:79
@ Button_Up
Definition DtVirtualRealityControllerState.h:84
@ Button_Right
Definition DtVirtualRealityControllerState.h:85
@ Button_System
Definition DtVirtualRealityControllerState.h:76
@ Button_Thumb
Definition DtVirtualRealityControllerState.h:82
@ Button_Left
Definition DtVirtualRealityControllerState.h:83
@ Button_A
Definition DtVirtualRealityControllerState.h:80
virtual Bitfield controllerType() const
Bitfield of controller DeviceType properties.
std::vector< DtVector2f > myAxisDeadZones
Definition DtVirtualRealityControllerState.h:306
virtual ControllerId controllerId() const
Unique integer identifier for this VR Controller device.
static Bitfield bit(unsigned int n)
Converts an integer to the corresponding bit in a bitfield.
DeviceType
Non-exclusive controller device properties.
Definition DtVirtualRealityControllerState.h:62
@ Type_Tracked
Definition DtVirtualRealityControllerState.h:66
@ Type_Undefined
Definition DtVirtualRealityControllerState.h:63
@ Type_Left
Definition DtVirtualRealityControllerState.h:64
@ Type_HMD
Definition DtVirtualRealityControllerState.h:68
@ Type_RightHand
Definition DtVirtualRealityControllerState.h:70
@ Type_Input
Definition DtVirtualRealityControllerState.h:67
@ Type_LeftHand
Definition DtVirtualRealityControllerState.h:69
@ Type_Right
Definition DtVirtualRealityControllerState.h:65
std::vector< DtVector2f > myAxisStates
Definition DtVirtualRealityControllerState.h:305
virtual bool touchChanged(TouchId touchid) const
Returns whether a particular surface with specified ID has changed touch state since the last event c...
virtual void setTouchStates(Bitfield touchStates)
virtual void setControllerType(Bitfield)
virtual DtVector position() const
Current position of this controller. This is an East-North-Up coordinate system with respect to the o...
DtVector myPosition
Definition DtVirtualRealityControllerState.h:299
virtual bool controllerMoved() const
Returns whether there has been any change to the tracked position or orientation of this controller s...
ControllerEventType
Overall status of this controller.
Definition DtVirtualRealityControllerState.h:141
@ ControllerLost
Definition DtVirtualRealityControllerState.h:144
@ StateChanged
Definition DtVirtualRealityControllerState.h:145
@ ControllerDiscovered
Definition DtVirtualRealityControllerState.h:143
@ NoEvent
Definition DtVirtualRealityControllerState.h:142
virtual bool axisChanged(AxisId axisId) const
Returns whether a particular axis with specified ID has had a value changed since the last event cycl...
virtual bool buttonReleased(ButtonId buttonId) const
virtual DtVector2f axisPosition(AxisId axisId) const
Returns the current values of a given axis. All axes are 2-dimensional, though some only use one,...
virtual bool touchState(TouchId touchId) const
Get an individual surface state by unique touchId. true == touched, touchId must be < number of bits ...
Bitfield myButtonsChanged
Definition DtVirtualRealityControllerState.h:312
TouchId
Unique known touch surface IDs; controller may have additional surfaces.
Definition DtVirtualRealityControllerState.h:91
@ Touch_B
Definition DtVirtualRealityControllerState.h:95
@ Touch_Trigger
Definition DtVirtualRealityControllerState.h:92
@ Touch_Thumb
Definition DtVirtualRealityControllerState.h:96
@ Touch_Grip
Definition DtVirtualRealityControllerState.h:93
@ Touch_A
Definition DtVirtualRealityControllerState.h:94
DtVirtualRealityControllerState()
Default constructor.
virtual DtQuat orientation() const
Current orientation of this controller. This is an East-North-Up coordinate system with respect to th...
virtual bool touchEnded(TouchId touchId) const
virtual ControllerEventType controllerEvent() const
Returns ControllerEventType describing the state of this controller after the most recent update.
virtual void setTouchState(TouchId touchId, bool touched)
virtual ~DtVirtualRealityControllerState()
Virtual destructor.
virtual bool buttonPressed(ButtonId buttonId) const
Returns whether the button with specified ID was pressed/released since the last event cycle.
unsigned long long Bitfield
Type used for bit flags throughout the class.
Definition DtVirtualRealityControllerState.h:41
virtual void clearEvent()
Resets all change flags to 0/false and event type to NoEvent. This should be called after the event p...
Bitfield myButtonStates
Definition DtVirtualRealityControllerState.h:302
virtual void markStateChanged()
virtual Bitfield touchChanged() const
Returns a bitfield identifying all the surfaces which have changed touch state since the last event c...
virtual void setAxisDeadZone(AxisId axisId, const DtVector2f &value)
DtQuat myOrientation
Definition DtVirtualRealityControllerState.h:300
virtual bool touchStarted(TouchId touchId) const
Returns whether the specified touch surface was touched or un-touched since the last event cycle.
virtual void setOrientation(const DtQuat &ori)
virtual bool buttonState(ButtonId buttonId) const
Get an individual button state by unique buttonId. true == button down, buttonId must be < number of ...
bool myControllerMoved
Definition DtVirtualRealityControllerState.h:315
virtual Bitfield touchStates() const
Bitfield of all the touch surface states of the controller. Each bit represents a surface state,...
virtual bool buttonChanged(ButtonId buttonId) const
Returns whether a particular button with specified ID has changed state since the last event cycle.
DtVirtualRealityControllerState(const DtVirtualRealityControllerState &orig)
Copy constructor.
unsigned int ControllerId
Type used for controller identification.
Definition DtVirtualRealityControllerState.h:46
virtual void setControllerAsLost()
Marks this controller as lost; event type is set to ControllerLost. Is is expected that this controll...
Bitfield myControllerType
Definition DtVirtualRealityControllerState.h:295
static unsigned int MaxAxes()
Gets the maximum number of analog axes supported by the system.
Bitfield myTouchStates
Definition DtVirtualRealityControllerState.h:303
Bitfield myTouchChanged
Definition DtVirtualRealityControllerState.h:313
ControllerId myControllerId
Definition DtVirtualRealityControllerState.h:294
virtual Bitfield buttonStates() const
Bitfield of all the button states of the controller. Each bit represents a button state,...
ControllerEventType myEventType
Definition DtVirtualRealityControllerState.h:310
AxisId
Unique known axis IDs; controller may have additional axes.
Definition DtVirtualRealityControllerState.h:101
@ Axis_Trigger
Definition DtVirtualRealityControllerState.h:103
@ Axis_Thumb
Definition DtVirtualRealityControllerState.h:102
@ Axis_4
Definition DtVirtualRealityControllerState.h:106
@ Axis_3
Definition DtVirtualRealityControllerState.h:105
@ Axis_Grip
Definition DtVirtualRealityControllerState.h:104
virtual Bitfield buttonsChanged() const
Returns a bitfield identifying all the buttons which have changed since the last event cycle....
virtual void setControllerId(ControllerId)
virtual Bitfield axesChanged() const
Returns bitfield identifying all axes which have changed since the last event cycle....
Bitfield myAxesChanged
Definition DtVirtualRealityControllerState.h:314
virtual DtVector2f axisDeadZone(AxisId axisId) const
Returns the dead-zone values of a given axis. Dead-zones are defined independently for x and y axis c...
virtual void setButtonState(ButtonId buttonId, bool down)
DtVirtualRealityControllerState & operator=(const DtVirtualRealityControllerState &rhs)
Assignment operator.
virtual void setPosition(const DtVector &pos)
Definition appLauncherComponent.h:28
Main header file for the VRV Virtual Reality Controller module.