Class VARJOMarkerTracking
Varjo Markers are physical markers tracked by the video cameras of the HMD. Different types of markers can be used for different purposes. As an example, Varjo Markers can be used as cheap replacements for electronic trackers. The cost per printed tracker is significantly lower and the markers require no power to function.
This extension provides the tracking interface to a set of marker types and sizes. Markers can be printed out from the PDF documents and instructions freely available at https://developer.varjo.com/docs/get-started/varjo-markers#printing-varjo-markers. Note that the printed marker must have the exact physical size for its ID.
Object markers are used to track static or dynamic objects in the user environment. You may use object markers in both XR and VR applications. Each marker has a unique ID, and you must not use the same physical marker more than once in any given environment. For added precision, an application may use multiple markers to track a single object. For example, you could track a monitor by placing a marker in each corner.
There is a set of marker IDs recognized by runtime and if the application uses ID which is not in the set then runtime must return ERROR_MARKER_ID_INVALID_VARJO.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtendsXrResult.static final intExtendsXrResult.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final StringThe extension name.static final intThe extension specification version. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrCreateMarkerSpaceVARJO(XrSession session, long createInfo, long space) Unsafe version of:CreateMarkerSpaceVARJOstatic intnxrGetMarkerSizeVARJO(XrSession session, long markerId, long size) Unsafe version of:GetMarkerSizeVARJOstatic intxrCreateMarkerSpaceVARJO(XrSession session, XrMarkerSpaceCreateInfoVARJO createInfo, org.lwjgl.PointerBuffer space) Creates marker space.static intxrGetMarkerSizeVARJO(XrSession session, long markerId, XrExtent2Df size) Gets physical size of marker.static intxrSetMarkerTrackingPredictionVARJO(XrSession session, long markerId, boolean enable) Sets marker tracking with prediction.static intxrSetMarkerTrackingTimeoutVARJO(XrSession session, long markerId, long timeout) Sets marker lifetime duration.static intxrSetMarkerTrackingVARJO(XrSession session, boolean enabled) Enables marker tracking.
-
Field Details
-
XR_VARJO_marker_tracking_SPEC_VERSION
public static final int XR_VARJO_marker_tracking_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_VARJO_MARKER_TRACKING_EXTENSION_NAME
The extension name.- See Also:
-
XR_TYPE_SYSTEM_MARKER_TRACKING_PROPERTIES_VARJO
public static final int XR_TYPE_SYSTEM_MARKER_TRACKING_PROPERTIES_VARJOExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_EVENT_DATA_MARKER_TRACKING_UPDATE_VARJO
public static final int XR_TYPE_EVENT_DATA_MARKER_TRACKING_UPDATE_VARJOExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_MARKER_SPACE_CREATE_INFO_VARJO
public static final int XR_TYPE_MARKER_SPACE_CREATE_INFO_VARJOExtendsXrStructureType.Enum values:
- See Also:
-
XR_ERROR_MARKER_NOT_TRACKED_VARJO
public static final int XR_ERROR_MARKER_NOT_TRACKED_VARJO- See Also:
-
XR_ERROR_MARKER_ID_INVALID_VARJO
public static final int XR_ERROR_MARKER_ID_INVALID_VARJO- See Also:
-
-
Method Details
-
xrSetMarkerTrackingVARJO
Enables marker tracking.C Specification
The
SetMarkerTrackingVARJOfunction is defined as:XrResult xrSetMarkerTrackingVARJO( XrSession session, XrBool32 enabled);Description
The
SetMarkerTrackingVARJOfunction enables or disables marker tracking functionality. As soon as feature is become disabled all trackable markers become inactive and corresponding events will be generated. An application may call any of the functions in this extension regardless if the marker tracking functionality is enabled or disabled.Valid Usage (Implicit)
- The
XR_VARJO_marker_trackingextension must be enabled prior to callingSetMarkerTrackingVARJO sessionmust be a validXrSessionhandle
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
session- anXrSessionhandle previously created withCreateSession.enabled- the flag to enable or disable marker tracking.
- The
-
xrSetMarkerTrackingTimeoutVARJO
Sets marker lifetime duration.C Specification
The
SetMarkerTrackingTimeoutVARJOfunction is defined as:XrResult xrSetMarkerTrackingTimeoutVARJO( XrSession session, uint64_t markerId, XrDuration timeout);Description
The
SetMarkerTrackingTimeoutVARJOfunction sets a desired lifetime duration for a specified marker. The default value isNO_DURATION. Negative value will be clamped toNO_DURATION. It defines the time period during which the runtime must keep returning poses of previously tracked markers. The tracking may be lost if the marker went outside of the trackable field of view. In this case the runtime still will try to predict marker’s pose for the timeout period. The runtime must returnERROR_MARKER_ID_INVALID_VARJOif the suppliedmarkerIdis invalid.Valid Usage (Implicit)
- The
XR_VARJO_marker_trackingextension must be enabled prior to callingSetMarkerTrackingTimeoutVARJO sessionmust be a validXrSessionhandle
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
session- anXrSessionhandle previously created withCreateSession.markerId- the unique identifier of the marker for which the timeout will be updated.timeout- the desired lifetime duration for a specified marker.
- The
-
xrSetMarkerTrackingPredictionVARJO
public static int xrSetMarkerTrackingPredictionVARJO(XrSession session, long markerId, boolean enable) Sets marker tracking with prediction.C Specification
The
SetMarkerTrackingPredictionVARJOfunction is defined as:XrResult xrSetMarkerTrackingPredictionVARJO( XrSession session, uint64_t markerId, XrBool32 enable);Description
The
SetMarkerTrackingPredictionVARJOfunction enables or disables the prediction feature for a specified marker. By default, markers are created with disabled prediction. This works well for markers that are supposed to be stationary. The prediction can be used to improve tracking of movable markers. The runtime must returnERROR_MARKER_ID_INVALID_VARJOif the suppliedmarkerIdis invalid.Valid Usage (Implicit)
- The
XR_VARJO_marker_trackingextension must be enabled prior to callingSetMarkerTrackingPredictionVARJO sessionmust be a validXrSessionhandle
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
session- anXrSessionhandle previously created withCreateSession.markerId- the unique identifier of the marker which should be tracked with prediction.enable- whether to enable the prediction feature.
- The
-
nxrGetMarkerSizeVARJO
Unsafe version of:GetMarkerSizeVARJO -
xrGetMarkerSizeVARJO
Gets physical size of marker.C Specification
The
GetMarkerSizeVARJOfunction is defined as:XrResult xrGetMarkerSizeVARJO( XrSession session, uint64_t markerId, XrExtent2Df* size);Description
The
GetMarkerSizeVARJOfunction retrieves the height and width of an active marker. The runtime must returnERROR_MARKER_NOT_TRACKED_VARJOif marker tracking functionality is disabled or the marker with givenmarkerIdis inactive. The runtime must returnERROR_MARKER_ID_INVALID_VARJOif the suppliedmarkerIdis invalid.Valid Usage (Implicit)
- The
XR_VARJO_marker_trackingextension must be enabled prior to callingGetMarkerSizeVARJO sessionmust be a validXrSessionhandlesizemust be a pointer to anXrExtent2Dfstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- anXrSessionhandle previously created withCreateSession.markerId- the unique identifier of the marker for which size is requested.size- pointer to the size to populate by the runtime with the physical size of plane marker in meters.
- The
-
nxrCreateMarkerSpaceVARJO
Unsafe version of:CreateMarkerSpaceVARJO -
xrCreateMarkerSpaceVARJO
public static int xrCreateMarkerSpaceVARJO(XrSession session, XrMarkerSpaceCreateInfoVARJO createInfo, org.lwjgl.PointerBuffer space) Creates marker space.C Specification
The
CreateMarkerSpaceVARJOfunction is defined as:XrResult xrCreateMarkerSpaceVARJO( XrSession session, const XrMarkerSpaceCreateInfoVARJO* createInfo, XrSpace* space);Description
The
CreateMarkerSpaceVARJOfunction creates markerXrSpacefor pose relative to the marker specified inXrMarkerSpaceCreateInfoVARJO. The runtime must returnERROR_MARKER_ID_INVALID_VARJOif the suppliedXrMarkerSpaceCreateInfoVARJO::markerIdis invalid.Valid Usage (Implicit)
- The
XR_VARJO_marker_trackingextension must be enabled prior to callingCreateMarkerSpaceVARJO sessionmust be a validXrSessionhandlecreateInfomust be a pointer to a validXrMarkerSpaceCreateInfoVARJOstructurespacemust be a pointer to anXrSpacehandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- anXrSessionhandle previously created withCreateSession.createInfo- the structure containing information about how to create the space based on marker.space- a pointer to a handle in which the createdXrSpaceis returned.
- The
-