Controller button press and release event. More...
#include <Inventor/events/SoControllerButtonEvent.h>
Public Types | |
enum | Button { ANY = 0 , BUTTON1 = 1 , BUTTON2 = 2 , BUTTON3 = 3 } |
Button. More... | |
Public Types inherited from SoButtonEvent | |
enum | State { UP , DOWN , DBCLK , UNKNOWN } |
State. More... | |
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoControllerButtonEvent () | |
Constructor. | |
void | setButton (SoControllerButtonEvent::Button b) |
Set which button generated the event. | |
SoControllerButtonEvent::Button | getButton () const |
Get which button generated the event. | |
void | setPosition3 (const SbVec3f &p) |
Set position of associated tracker in world coordinates. | |
const SbVec3f & | getPosition3 () const |
Get position of associated tracker in world coordinates. | |
void | setOrientation (float x, float y, float z) |
Set orientation value of associated tracker from Euler angles in radians (using the trackd convention Z*X*Y). | |
void | setOrientation (SbRotation orientation) |
Set orientation value of associated tracker from an SbRotation. | |
void | setOrientation (const SbVec3f &axis, float angle) |
Set orientation value of associated tracker from axis and angle in radians. | |
const SbRotation & | getOrientation () const |
Get orientation of associated tracker as a standard Open Inventor rotation (quaternion). | |
const SbLine | getRay () const |
Get a ray for picking/intersecting. | |
virtual const SbTrackerInfo * | getTrackerInfo () const |
Returns the SbTrackerInfo object. | |
virtual const SbTrackerInfo & | trackerInfo () const |
Get the SbTrackerInfo object. | |
virtual const SbTrackerInfo * | getTrackerInfo () const |
Gets whether an event object has associated tracker information. | |
SbTrackerInfo * | getTrackerInfo () |
Gets whether an event object has associated tracker information. | |
Public Member Functions inherited from SoButtonEvent | |
SoButtonEvent () | |
Constructor. | |
void | setState (SoButtonEvent::State s) |
Sets the state of the button. | |
SoButtonEvent::State | getState () const |
Gets the state of the button. | |
Public Member Functions inherited from SoEvent | |
SoEvent () | |
Constructor. | |
virtual | ~SoEvent () |
Destructor. | |
virtual void | setTime (SbTime t) |
Sets the time at which the event occurred. | |
SbTime | getTime () const |
Gets the time at which the event occurred. | |
virtual void | setPosition (const SbVec2s &p) |
Sets the window pixel location of the cursor when the event occurred. | |
virtual void | setPosition (const SbVec2f &p) |
Float version of setPosition(const SbVec2s &p). | |
const SbVec2s & | getPosition () const |
Returns the window pixel location of the cursor when the event occurred as integer values. | |
const SbVec2f & | getPositionFloat () const |
Returns the window pixel location of the cursor when the event occurred as float values. | |
const SbVec2s & | getPosition (const SbViewportRegion &vpRgn) const |
Gets the viewport pixel location of the cursor when the event occurred, relative to the origin of the specified viewport region, as integer values. | |
const SbVec2f & | getPositionFloat (const SbViewportRegion &vpRgn) const |
Gets the viewport pixel location of the cursor when the event occurred, relative to the origin of the specified viewport region, as float values. | |
const SbVec2f & | getNormalizedPosition (const SbViewportRegion &vpRgn) const |
Gets the normalized location of the cursor when the event occurred, relative to the specified viewport region. | |
void | setShiftDown (SbBool isDown) |
Sets whether the shift key was down when the event occurred. | |
void | setCtrlDown (SbBool isDown) |
Sets whether the CTRL key was down when the event occurred. | |
void | setAltDown (SbBool isDown) |
Sets whether the ALT key was down when the event occurred. | |
void | setButton1Down (SbBool isDown) |
Sets whether mouse Button 1 was down when the event occurred. | |
SbBool | wasShiftDown () const |
Returns true if the shift key was down when the event occurred. | |
SbBool | wasCtrlDown () const |
Returns true if the CTRL key was down when the event occurred. | |
SbBool | wasAltDown () const |
Returns true if the ALT key was down when the event occurred. | |
SbBool | wasButton1Down () const |
Returns true if mouse button 1 was down when the event occurred. | |
SbTrackerInfo * | getTrackerInfo () |
Gets whether an event object has associated tracker information. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static SbBool | isButtonPressEvent (const SoEvent *e, SoControllerButtonEvent::Button whichButton) |
Convenience function to see if an SoEvent is a press of the passed mouse button. | |
static SbBool | isButtonReleaseEvent (const SoEvent *e, SoControllerButtonEvent::Button whichButton) |
Convenience function to see if an SoEvent is a release of the passed mouse button. | |
Static Public Member Functions inherited from SoButtonEvent | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoEvent | |
static SoType | getClassTypeId () |
Returns the type id for the SoEvent class. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Controller button press and release event.
SoControllerButtonEvent represents controller button press and release events in the Open Inventor event model. A controller device generally has associated 3D tracker information.
A "tracker" is any device whose position and orientation are dynamically tracked in 3D, typically for immersive VR applications. For example: a head tracker. A "controller" is an input device which typically has buttons and/or valuators (e.g. a joystick). Many controllers have an associated tracker. For example, the commonly used "wand" input device has three buttons, a two-axis joystick (two valuators), and an associated tracker.
The virtual method SoEvent::getTrackerInfo() can be used to determine if an event object has associated tracker information. Traditional 2D events like SoMouseButtonEvent and SoLocation2Event return NULL. 3D events like SoTrackerEvent and SoControllerButtonEvent return a their associated tracker information (SbTrackerInfo).
Many controller devices generate a continuous stream of data, so strictly speaking there are no "events". However Open Inventor classes that recognize the SoControllerButtonEvent interpret it as notification of a change in the button state (press or release). The application (or other software above Open Inventor) is responsible for deciding when to actually create an SoControllerButtonEvent.
Some convenience macros for determining if an event matches
SbTrackerInfo, SoEvent, SoTrackerEvent
Definition at line 82 of file SoControllerButtonEvent.h.
Button.
Enumerator | |
---|---|
ANY | |
BUTTON1 | Controller button 1. |
BUTTON2 | Controller button 2. |
BUTTON3 | Controller button 3. |
Definition at line 89 of file SoControllerButtonEvent.h.
SoControllerButtonEvent::SoControllerButtonEvent | ( | ) |
Constructor.
|
inline |
Get which button generated the event.
Definition at line 120 of file SoControllerButtonEvent.h.
|
static |
Returns the type identifier for this class.
|
inline |
Get orientation of associated tracker as a standard Open Inventor rotation (quaternion).
Definition at line 157 of file SoControllerButtonEvent.h.
|
inline |
Get position of associated tracker in world coordinates.
Definition at line 131 of file SoControllerButtonEvent.h.
|
inline |
Get a ray for picking/intersecting.
This is a convenience function.
Definition at line 163 of file SoControllerButtonEvent.h.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Returns the SbTrackerInfo object.
Can be used as a quick check if an SoEvent has tracker info associated with it.
Reimplemented from SoEvent.
Definition at line 176 of file SoControllerButtonEvent.h.
|
virtual |
Returns the type identifier for this specific instance.
Reimplemented from SoButtonEvent.
|
static |
Convenience function to see if an SoEvent is a press of the passed mouse button.
|
static |
Convenience function to see if an SoEvent is a release of the passed mouse button.
|
inline |
Set which button generated the event.
Definition at line 116 of file SoControllerButtonEvent.h.
|
inline |
Set orientation value of associated tracker from axis and angle in radians.
Definition at line 150 of file SoControllerButtonEvent.h.
|
inline |
Set orientation value of associated tracker from Euler angles in radians (using the trackd convention Z*X*Y).
Definition at line 138 of file SoControllerButtonEvent.h.
|
inline |
Set orientation value of associated tracker from an SbRotation.
Definition at line 144 of file SoControllerButtonEvent.h.
|
inline |
Set position of associated tracker in world coordinates.
Definition at line 125 of file SoControllerButtonEvent.h.
|
inlinevirtual |
Get the SbTrackerInfo object.
Definition at line 182 of file SoControllerButtonEvent.h.