public class SoControllerButtonEvent extends SoButtonEvent
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
.
See also:
Modifier and Type | Class and Description |
---|---|
static class |
SoControllerButtonEvent.Buttons
Button.
|
SoButtonEvent.States
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
static int |
ANY
Deprecated.
Use
SoControllerButtonEvent.Buttons.ANY instead. |
static int |
BUTTON1
Deprecated.
Use
SoControllerButtonEvent.Buttons.BUTTON1 instead. |
static int |
BUTTON2
Deprecated.
Use
SoControllerButtonEvent.Buttons.BUTTON2 instead. |
static int |
BUTTON3
Deprecated.
Use
SoControllerButtonEvent.Buttons.BUTTON3 instead. |
DBCLK, DOWN, UNKNOWN, UP
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoControllerButtonEvent()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SoControllerButtonEvent.Buttons |
getButton()
Get which button generated the event.
|
SbRotation |
getOrientation()
Get orientation of associated tracker as a standard Open Inventor rotation (quaternion).
|
SbVec3f |
getPosition3()
Get position of associated tracker in world coordinates.
|
SbLine |
getRay()
Get a ray for picking/intersecting.
|
static boolean |
isButtonPressEvent(SoEvent e,
SoControllerButtonEvent.Buttons whichButton)
Convenience function to see if an
SoEvent is a press of the passed mouse button. |
static boolean |
isButtonReleaseEvent(SoEvent e,
SoControllerButtonEvent.Buttons whichButton)
Convenience function to see if an
SoEvent is a release of the passed mouse button. |
void |
setButton(SoControllerButtonEvent.Buttons b)
Set which button generated the event.
|
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(SbVec3f axis,
float angle)
Set orientation value of associated tracker from axis and angle in radians.
|
void |
setPosition3(SbVec3f p)
Set position of associated tracker in world coordinates.
|
SbTrackerInfo |
trackerInfo()
Get the
SbTrackerInfo object. |
getState, setState
getNormalizedPosition, getPosition, getPosition, getPositionFloat, getPositionFloat, getTime, setAltDown, setButton1Down, setCtrlDown, setPosition, setPosition, setShiftDown, setTime, wasAltDown, wasButton1Down, wasCtrlDown, wasShiftDown
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int ANY
SoControllerButtonEvent.Buttons.ANY
instead.@Deprecated public static final int BUTTON1
SoControllerButtonEvent.Buttons.BUTTON1
instead.@Deprecated public static final int BUTTON2
SoControllerButtonEvent.Buttons.BUTTON2
instead.@Deprecated public static final int BUTTON3
SoControllerButtonEvent.Buttons.BUTTON3
instead.public SbLine getRay()
public SbTrackerInfo trackerInfo()
SbTrackerInfo
object.public void setButton(SoControllerButtonEvent.Buttons b)
public static boolean isButtonPressEvent(SoEvent e, SoControllerButtonEvent.Buttons whichButton)
SoEvent
is a press of the passed mouse button.public SbVec3f getPosition3()
public SoControllerButtonEvent.Buttons getButton()
public void setPosition3(SbVec3f p)
public void setOrientation(float x, float y, float z)
public void setOrientation(SbVec3f axis, float angle)
public SbRotation getOrientation()
public void setOrientation(SbRotation orientation)
SbRotation
.public static boolean isButtonReleaseEvent(SoEvent e, SoControllerButtonEvent.Buttons whichButton)
SoEvent
is a release of the passed mouse button.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com