Class HTCAnchor
This extension allows an application to create a spatial anchor to track a point in the physical environment. The runtime adjusts the pose of the anchor over time to align it with the real world.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtendsXrResult.static final StringThe extension name.static final intThe extension specification version.static final intXR_MAX_SPATIAL_ANCHOR_NAME_SIZE_HTCstatic final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrCreateSpatialAnchorHTC(XrSession session, long createInfo, long anchor) Unsafe version of:CreateSpatialAnchorHTCstatic intnxrGetSpatialAnchorNameHTC(XrSpace anchor, long name) Unsafe version of:GetSpatialAnchorNameHTCstatic intxrCreateSpatialAnchorHTC(XrSession session, XrSpatialAnchorCreateInfoHTC createInfo, org.lwjgl.PointerBuffer anchor) Creates a spatial anchor.static intxrGetSpatialAnchorNameHTC(XrSpace anchor, XrSpatialAnchorNameHTC name) Get name of a spatial anchor.
-
Field Details
-
XR_HTC_anchor_SPEC_VERSION
public static final int XR_HTC_anchor_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_HTC_ANCHOR_EXTENSION_NAME
The extension name.- See Also:
-
XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_HTC
public static final int XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_HTCXR_MAX_SPATIAL_ANCHOR_NAME_SIZE_HTC- See Also:
-
XR_TYPE_SYSTEM_ANCHOR_PROPERTIES_HTC
public static final int XR_TYPE_SYSTEM_ANCHOR_PROPERTIES_HTCExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_HTC
public static final int XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_HTCExtendsXrStructureType.Enum values:
- See Also:
-
XR_ERROR_NOT_AN_ANCHOR_HTC
public static final int XR_ERROR_NOT_AN_ANCHOR_HTCExtendsXrResult.- See Also:
-
-
Method Details
-
nxrCreateSpatialAnchorHTC
Unsafe version of:CreateSpatialAnchorHTC -
xrCreateSpatialAnchorHTC
public static int xrCreateSpatialAnchorHTC(XrSession session, XrSpatialAnchorCreateInfoHTC createInfo, org.lwjgl.PointerBuffer anchor) Creates a spatial anchor.C Specification
The
CreateSpatialAnchorHTCfunction is defined as:XrResult xrCreateSpatialAnchorHTC( XrSession session, const XrSpatialAnchorCreateInfoHTC* createInfo, XrSpace* anchor);Description
The
CreateSpatialAnchorHTCfunction creates a spatial anchor with specified base space and pose in the space. The anchor is represented by anXrSpaceand its pose can be tracked viaLocateSpace. Once the anchor is no longer needed, callDestroySpaceto erase the anchor.Valid Usage (Implicit)
- The
XR_HTC_anchorextension must be enabled prior to callingCreateSpatialAnchorHTC sessionmust be a validXrSessionhandlecreateInfomust be a pointer to a validXrSpatialAnchorCreateInfoHTCstructureanchormust be a pointer to anXrSpacehandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- theXrSessionto create the anchor in.createInfo- theXrSpatialAnchorCreateInfoHTCused to specify the anchor.anchor- the returnedXrSpacehandle.
- The
-
nxrGetSpatialAnchorNameHTC
Unsafe version of:GetSpatialAnchorNameHTC -
xrGetSpatialAnchorNameHTC
Get name of a spatial anchor.C Specification
The
GetSpatialAnchorNameHTCfunction is defined as:XrResult xrGetSpatialAnchorNameHTC( XrSpace anchor, XrSpatialAnchorNameHTC* name);Description
The
GetSpatialAnchorNameHTCfunction gets the name of an anchor. If the providedanchoris a valid space handle but was not created withCreateSpatialAnchorHTC, the runtime must returnERROR_NOT_AN_ANCHOR_HTC.Valid Usage (Implicit)
- The
XR_HTC_anchorextension must be enabled prior to callingGetSpatialAnchorNameHTC anchormust be a validXrSpacehandlenamemust be a pointer to anXrSpatialAnchorNameHTCstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
anchor- theXrSpacecreated byCreateSpatialAnchorHTC.name- a pointer to outputXrSpatialAnchorNameHTC.
- The
-