Class SbTrackerInfo
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.events.SbTrackerInfo
-
public class SbTrackerInfo extends Inventor
Class for representing 3D tracker information. An object that stores information about the state of a 3D tracker device, specifically position and orientation.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 a pointer to their associated tracker information (SbTrackerInfo
).In addition to the usual methods for setting an orientation, this class provides a method that takes three Euler angles specified in radians. This allows orientation information returned by the widely used trackd API to be stored directly into an Open Inventor event object.
Tracker info is most often used by Open Inventor classes to specify a direction for picking or intersection with a dragger. This class provides the
getRay()
method to conveniently get anSbLine
defining the direction the tracker is pointing.This class also provides a void * data member that could be used, for example, to distinguish different tracker devices or communicate any other information between an application and custom nodes in the scene graph. Open Inventor does not set or use this variable.
- See Also:
SoControllerButtonEvent
,SoEvent
,SoTrackerEvent
-
-
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 SbTrackerInfo()
Constructor.SbTrackerInfo(SbTrackerInfo copyFrom)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SbRotation
getOrientation()
Get orientation of tracker as a standard Open Inventor rotation (quaternion).SbVec3f
getPosition3()
Get position of tracker in world coordinates.SbLine
getRay()
Convenience function to get ray for picking/intersecting.void
setOrientation(float[] q)
Set orientation value from array of 4 floats defining the rotation quaternion.void
setOrientation(float xangle, float yangle, float zangle)
Set orientation value from Euler angles in radians (using the trackd convention Z*X*Y).void
setOrientation(float q0, float q1, float q2, float q3)
Set orientation value from 4 floats defining the rotation quaternion.void
setOrientation(SbRotation orientation)
Set orientation value from anSbRotation
.void
setOrientation(SbVec3f axis, float angle)
Set orientation value from axis and angle in radians.void
setPosition3(SbVec3f p)
Set position of tracker in world coordinates.void
setValue(SbTrackerInfo copyFrom)
static SbTrackerInfo[]
toArray(long nativeArray, long length)
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Constructor Detail
-
SbTrackerInfo
public SbTrackerInfo(SbTrackerInfo copyFrom)
-
SbTrackerInfo
public SbTrackerInfo()
Constructor.
-
-
Method Detail
-
setOrientation
public void setOrientation(SbVec3f axis, float angle)
Set orientation value from axis and angle in radians.
-
toArray
public static SbTrackerInfo[] toArray(long nativeArray, long length)
-
setValue
public void setValue(SbTrackerInfo copyFrom)
-
setOrientation
public void setOrientation(SbRotation orientation)
Set orientation value from anSbRotation
.
-
getOrientation
public SbRotation getOrientation()
Get orientation of tracker as a standard Open Inventor rotation (quaternion).
-
setOrientation
public void setOrientation(float[] q)
Set orientation value from array of 4 floats defining the rotation quaternion.
-
setOrientation
public void setOrientation(float q0, float q1, float q2, float q3)
Set orientation value from 4 floats defining the rotation quaternion.
-
getRay
public SbLine getRay()
Convenience function to get ray for picking/intersecting.
-
setPosition3
public void setPosition3(SbVec3f p)
Set position of tracker in world coordinates.
-
setOrientation
public void setOrientation(float xangle, float yangle, float zangle)
Set orientation value from Euler angles in radians (using the trackd convention Z*X*Y).
-
getPosition3
public SbVec3f getPosition3()
Get position of tracker in world coordinates.
-
-