Class SoTrackerEvent
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.events.SoEvent
-
- com.openinventor.inventor.events.SoTrackerEvent
-
public class SoTrackerEvent extends SoEvent
3D tracker event.SoTrackerEvent
represents 3D position and orientation events in the Open Inventor event model.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
andSoLocation2Event
return NULL. 3D events likeSoTrackerEvent
andSoControllerButtonEvent
return their associated tracker information (SbTrackerInfo
).Many tracker devices generate a continuous stream of position and orientation reports, so strictly speaking there are no "events." Generally Open Inventor classes that recognize the
SoTrackerEvent
interpret it as notification of a "significant" change in the tracker position and/or orientation. Processing of SoTrackerEvents may be relatively expensive. For example, a pick operation will usually be done automatically. The application (or other software above Open Inventor) is responsible for deciding when to actually create anSoTrackerEvent
.- See Also:
SoControllerButtonEvent
,SoEvent
,SbTrackerInfo
-
-
Nested Class Summary
-
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 SoTrackerEvent()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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 anSbRotation
.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()
Returns theSbTrackerInfo
object.-
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
-
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).
-
trackerInfo
public SbTrackerInfo trackerInfo()
Returns theSbTrackerInfo
object.
-
setOrientation
public void setOrientation(SbVec3f axis, float angle)
Set orientation value of associated tracker from axis and angle in radians.
-
getPosition3
public SbVec3f getPosition3()
Get position of associated tracker in world coordinates.
-
setOrientation
public void setOrientation(SbRotation orientation)
Set orientation value of associated tracker from anSbRotation
.
-
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.
-
getOrientation
public SbRotation getOrientation()
Get orientation of associated tracker as a standard Open Inventor rotation (quaternion).
-
-