Class SoControllerButtonEvent
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.events.SoEvent
-
- com.openinventor.inventor.events.SoButtonEvent
-
- com.openinventor.inventor.events.SoControllerButtonEvent
-
public class SoControllerButtonEvent extends SoButtonEvent
Controller button press and release event.SoControllerButtonEventrepresents 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
SoMouseButtonEventandSoLocation2Eventreturn NULL. 3D events likeSoTrackerEventandSoControllerButtonEventreturn 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
SoControllerButtonEventinterpret 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 anSoControllerButtonEvent.- See Also:
SbTrackerInfo,SoEvent,SoTrackerEvent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSoControllerButtonEvent.ButtonsButton.-
Nested classes/interfaces inherited from class com.openinventor.inventor.events.SoButtonEvent
SoButtonEvent.States
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoControllerButtonEvent()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SoControllerButtonEvent.ButtonsgetButton()Get which button generated the event.SbRotationgetOrientation()Get orientation of associated tracker as a standard Open Inventor rotation (quaternion).SbVec3fgetPosition3()Get position of associated tracker in world coordinates.SbLinegetRay()Get a ray for picking/intersecting.static booleanisButtonPressEvent(SoEvent e, SoControllerButtonEvent.Buttons whichButton)Convenience function to see if anSoEventis a press of the passed mouse button.static booleanisButtonReleaseEvent(SoEvent e, SoControllerButtonEvent.Buttons whichButton)Convenience function to see if anSoEventis a release of the passed mouse button.voidsetButton(SoControllerButtonEvent.Buttons b)Set which button generated the event.voidsetOrientation(float x, float y, float z)Set orientation value of associated tracker from Euler angles in radians (using the trackd convention Z*X*Y).voidsetOrientation(SbRotation orientation)Set orientation value of associated tracker from anSbRotation.voidsetOrientation(SbVec3f axis, float angle)Set orientation value of associated tracker from axis and angle in radians.voidsetPosition3(SbVec3f p)Set position of associated tracker in world coordinates.SbTrackerInfotrackerInfo()Get theSbTrackerInfoobject.-
Methods inherited from class com.openinventor.inventor.events.SoButtonEvent
getState, setState
-
Methods inherited from class com.openinventor.inventor.events.SoEvent
getNormalizedPosition, getPosition, getPosition, getPositionFloat, getPositionFloat, getTime, setAltDown, setButton1Down, setCtrlDown, setPosition, setPosition, setShiftDown, setTime, wasAltDown, wasButton1Down, wasCtrlDown, wasShiftDown
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
setPosition3
public void setPosition3(SbVec3f p)
Set position of associated tracker in world coordinates.
-
getRay
public SbLine getRay()
Get a ray for picking/intersecting. This is a convenience function.
-
trackerInfo
public SbTrackerInfo trackerInfo()
Get theSbTrackerInfoobject.
-
isButtonPressEvent
public static boolean isButtonPressEvent(SoEvent e, SoControllerButtonEvent.Buttons whichButton)
Convenience function to see if anSoEventis a press of the passed mouse button.
-
isButtonReleaseEvent
public static boolean isButtonReleaseEvent(SoEvent e, SoControllerButtonEvent.Buttons whichButton)
Convenience function to see if anSoEventis a release of the passed mouse button.
-
setOrientation
public 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).
-
setButton
public void setButton(SoControllerButtonEvent.Buttons b)
Set which button generated the event.
-
getPosition3
public SbVec3f getPosition3()
Get position of associated tracker in world coordinates.
-
getButton
public SoControllerButtonEvent.Buttons getButton()
Get which button generated the event.
-
setOrientation
public void setOrientation(SbVec3f axis, float angle)
Set orientation value of associated tracker from axis and angle in radians.
-
getOrientation
public SbRotation getOrientation()
Get orientation of associated tracker as a standard Open Inventor rotation (quaternion).
-
setOrientation
public void setOrientation(SbRotation orientation)
Set orientation value of associated tracker from anSbRotation.
-
-