Class FBSpatialEntity
This extension enables applications to use spatial entities to specify world-locked frames of reference. It enables applications to persist the real world location of content over time and contains definitions for the Entity-Component System. All Facebook spatial entity and scene extensions are dependent on this one.
We use OpenXR XrSpace handles to give applications access to spatial entities such as Spatial Anchors. In other words, any operation which involves spatial entities uses XrSpace handles to identify the affected spatial entities.
In order to enable the functionality of this extension, you must pass the name of the extension into CreateInstance via the XrInstanceCreateInfo::enabledExtensionNames parameter as indicated in the extension section.
This extension allows:
- An application to create a Spatial Anchor (a type of spatial entity).
- An application to enumerate supported components for a given spatial entity.
- An application to enable or disable a component for a given spatial entity.
- An application to get the status of a component for a given spatial entity.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtendsXrResult.static final intExtendsXrResult.static final intExtendsXrResult.static final intExtendsXrResult.static final StringThe extension name.static final intThe extension specification version.static final intXrSpaceComponentTypeFB - Component typestatic final intXrSpaceComponentTypeFB - Component typestatic final intXrSpaceComponentTypeFB - Component typestatic final intXrSpaceComponentTypeFB - Component typestatic final intXrSpaceComponentTypeFB - Component typestatic final intXrSpaceComponentTypeFB - Component typestatic final intXrSpaceComponentTypeFB - Component typestatic final intXrSpaceComponentTypeFB - Component typestatic final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrCreateSpatialAnchorFB(XrSession session, long info, long requestId) Unsafe version of:CreateSpatialAnchorFBstatic intnxrEnumerateSpaceSupportedComponentsFB(XrSpace space, int componentTypeCapacityInput, long componentTypeCountOutput, long componentTypes) Unsafe version of:EnumerateSpaceSupportedComponentsFBstatic intnxrGetSpaceComponentStatusFB(XrSpace space, int componentType, long status) Unsafe version of:GetSpaceComponentStatusFBstatic intnxrGetSpaceUuidFB(XrSpace space, long uuid) Unsafe version of:GetSpaceUuidFBstatic intnxrSetSpaceComponentStatusFB(XrSpace space, long info, long requestId) Unsafe version of:SetSpaceComponentStatusFBstatic intxrCreateSpatialAnchorFB(XrSession session, XrSpatialAnchorCreateInfoFB info, LongBuffer requestId) Creates a new spatial anchor.static intxrEnumerateSpaceSupportedComponentsFB(XrSpace space, IntBuffer componentTypeCountOutput, @Nullable IntBuffer componentTypes) Enumerates supported components for a given spatial entity.static intxrGetSpaceComponentStatusFB(XrSpace space, int componentType, XrSpaceComponentStatusFB status) Provides the current state of a component.static intxrGetSpaceUuidFB(XrSpace space, XrUuidEXT uuid) Gets an entity.static intxrSetSpaceComponentStatusFB(XrSpace space, XrSpaceComponentStatusSetInfoFB info, LongBuffer requestId) Enables or disables supported component interfaces for an entity.
-
Field Details
-
XR_FB_spatial_entity_SPEC_VERSION
public static final int XR_FB_spatial_entity_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_FB_SPATIAL_ENTITY_EXTENSION_NAME
The extension name.- See Also:
-
XR_TYPE_SYSTEM_SPATIAL_ENTITY_PROPERTIES_FB
public static final int XR_TYPE_SYSTEM_SPATIAL_ENTITY_PROPERTIES_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB
public static final int XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SPACE_COMPONENT_STATUS_SET_INFO_FB
public static final int XR_TYPE_SPACE_COMPONENT_STATUS_SET_INFO_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SPACE_COMPONENT_STATUS_FB
public static final int XR_TYPE_SPACE_COMPONENT_STATUS_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_EVENT_DATA_SPATIAL_ANCHOR_CREATE_COMPLETE_FB
public static final int XR_TYPE_EVENT_DATA_SPATIAL_ANCHOR_CREATE_COMPLETE_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_EVENT_DATA_SPACE_SET_STATUS_COMPLETE_FB
public static final int XR_TYPE_EVENT_DATA_SPACE_SET_STATUS_COMPLETE_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FB
public static final int XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FBExtendsXrResult.Enum values:
- See Also:
-
XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FB
public static final int XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FBExtendsXrResult.Enum values:
- See Also:
-
XR_ERROR_SPACE_COMPONENT_STATUS_PENDING_FB
public static final int XR_ERROR_SPACE_COMPONENT_STATUS_PENDING_FBExtendsXrResult.Enum values:
- See Also:
-
XR_ERROR_SPACE_COMPONENT_STATUS_ALREADY_SET_FB
public static final int XR_ERROR_SPACE_COMPONENT_STATUS_ALREADY_SET_FBExtendsXrResult.Enum values:
- See Also:
-
XR_SPACE_COMPONENT_TYPE_LOCATABLE_FB
public static final int XR_SPACE_COMPONENT_TYPE_LOCATABLE_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
XR_SPACE_COMPONENT_TYPE_STORABLE_FB
public static final int XR_SPACE_COMPONENT_TYPE_STORABLE_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
XR_SPACE_COMPONENT_TYPE_SHARABLE_FB
public static final int XR_SPACE_COMPONENT_TYPE_SHARABLE_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
XR_SPACE_COMPONENT_TYPE_BOUNDED_2D_FB
public static final int XR_SPACE_COMPONENT_TYPE_BOUNDED_2D_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
XR_SPACE_COMPONENT_TYPE_BOUNDED_3D_FB
public static final int XR_SPACE_COMPONENT_TYPE_BOUNDED_3D_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB
public static final int XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB
public static final int XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB
public static final int XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FBXrSpaceComponentTypeFB - Component typeDescription
Specify the component interfaces attached to the spatial entity.
Enumerant Descriptions
SPACE_COMPONENT_TYPE_LOCATABLE_FB— Enables tracking the 6 DOF pose of theXrSpacewithLocateSpace.SPACE_COMPONENT_TYPE_STORABLE_FB— Enables persistence operations: save and erase.SPACE_COMPONENT_TYPE_SHARABLE_FB— Enables sharing of spatial entities.SPACE_COMPONENT_TYPE_BOUNDED_2D_FB— Bounded 2D component.SPACE_COMPONENT_TYPE_BOUNDED_3D_FB— Bounded 3D component.SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB— Semantic labels component.SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB— Room layout component.SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB— Space container component.
See Also
XrEventDataSpaceSetStatusCompleteFB,XrSpaceComponentFilterInfoFB,XrSpaceComponentStatusSetInfoFB,EnumerateSpaceSupportedComponentsFB,GetSpaceComponentStatusFB- See Also:
-
-
Method Details
-
nxrCreateSpatialAnchorFB
Unsafe version of:CreateSpatialAnchorFB -
xrCreateSpatialAnchorFB
public static int xrCreateSpatialAnchorFB(XrSession session, XrSpatialAnchorCreateInfoFB info, LongBuffer requestId) Creates a new spatial anchor.C Specification
The
CreateSpatialAnchorFBfunction is defined as:XrResult xrCreateSpatialAnchorFB( XrSession session, const XrSpatialAnchorCreateInfoFB* info, XrAsyncRequestIdFB* requestId);Description
Creates a Spatial Anchor using the specified tracking origin and pose relative to the specified tracking origin. The anchor will be locatable at the time of creation, and the 6 DOF pose relative to the tracking origin can be queried using the
LocateSpacemethod. This operation is asynchronous and the runtime must post anXrEventDataSpatialAnchorCreateCompleteFBevent when the operation completes successfully or encounters an error. If this function returns a failure code, no event is posted. TherequestIdcan be used to later refer to the request, such as identifying which request has completed when anXrEventDataSpatialAnchorCreateCompleteFBis posted to the event queue.Valid Usage (Implicit)
- The
XR_FB_spatial_entityextension must be enabled prior to callingCreateSpatialAnchorFB sessionmust be a validXrSessionhandleinfomust be a pointer to a validXrSpatialAnchorCreateInfoFBstructurerequestIdmust be a pointer to anXrAsyncRequestIdFBvalue
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- a handle to anXrSession.info- a pointer to anXrSpatialAnchorCreateInfoFBstructure containing information about how to create the anchor.requestId- the output parameter that points to the ID of this asynchronous request.
- The
-
nxrGetSpaceUuidFB
Unsafe version of:GetSpaceUuidFB -
xrGetSpaceUuidFB
Gets an entity.C Specification
The
GetSpaceUuidFBfunction is defined as:XrResult xrGetSpaceUuidFB( XrSpace space, XrUuidEXT* uuid);Description
Gets the UUID for a spatial entity. If this space was previously created as a spatial anchor,
uuidmust be equal to theXrEventDataSpatialAnchorCreateCompleteFB::uuidin the event corresponding to the creation of that space. Subsequent calls toGetSpaceUuidFBusing the sameXrSpacemust return the sameXrUuidEXT.Valid Usage (Implicit)
- The
XR_FB_spatial_entityextension must be enabled prior to callingGetSpaceUuidFB spacemust be a validXrSpacehandleuuidmust be a pointer to anXrUuidEXTstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
space- theXrSpacehandle of a spatial entity.uuid- an output parameter pointing to the entity’s UUID.
- The
-
nxrEnumerateSpaceSupportedComponentsFB
public static int nxrEnumerateSpaceSupportedComponentsFB(XrSpace space, int componentTypeCapacityInput, long componentTypeCountOutput, long componentTypes) Unsafe version of:EnumerateSpaceSupportedComponentsFB- Parameters:
componentTypeCapacityInput- the capacity of thecomponentTypesarray, or 0 to indicate a request to retrieve the required capacity.
-
xrEnumerateSpaceSupportedComponentsFB
public static int xrEnumerateSpaceSupportedComponentsFB(XrSpace space, IntBuffer componentTypeCountOutput, @Nullable IntBuffer componentTypes) Enumerates supported components for a given spatial entity.C Specification
The
EnumerateSpaceSupportedComponentsFBfunction is defined as:XrResult xrEnumerateSpaceSupportedComponentsFB( XrSpace space, uint32_t componentTypeCapacityInput, uint32_t* componentTypeCountOutput, XrSpaceComponentTypeFB* componentTypes);Description
Lists any component types that an entity supports. The list of component types available for an entity depends on which extensions are enabled. Component types must not be enumerated unless the corresponding extension that defines them is also enabled.
Valid Usage (Implicit)
- The
XR_FB_spatial_entityextension must be enabled prior to callingEnumerateSpaceSupportedComponentsFB spacemust be a validXrSpacehandlecomponentTypeCountOutputmust be a pointer to auint32_tvalue- If
componentTypeCapacityInputis not 0,componentTypesmust be a pointer to an array ofcomponentTypeCapacityInputXrSpaceComponentTypeFBvalues
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
space- theXrSpacehandle to the spatial entity.componentTypeCountOutput- a pointer to the count ofcomponentTypeswritten, or a pointer to the required capacity in the case thatcomponentTypeCapacityInputis insufficient.componentTypes- a pointer to an array ofXrSpaceComponentTypeFBvalues, but can beNULLifcomponentTypeCapacityInputis 0.
- The
-
nxrSetSpaceComponentStatusFB
Unsafe version of:SetSpaceComponentStatusFB -
xrSetSpaceComponentStatusFB
public static int xrSetSpaceComponentStatusFB(XrSpace space, XrSpaceComponentStatusSetInfoFB info, LongBuffer requestId) Enables or disables supported component interfaces for an entity.C Specification
The
SetSpaceComponentStatusFBfunction is defined as:XrResult xrSetSpaceComponentStatusFB( XrSpace space, const XrSpaceComponentStatusSetInfoFB* info, XrAsyncRequestIdFB* requestId);Description
Enables or disables the specified component for the specified entity. This operation is asynchronous and always returns immediately, regardless of the value of
XrSpaceComponentStatusSetInfoFB::timeout. TherequestIdcan be used to later refer to the request, such as identifying which request has completed when anXrEventDataSpaceSetStatusCompleteFBis posted to the event queue. If this function returns a failure code, no event is posted. This function must returnERROR_SPACE_COMPONENT_NOT_SUPPORTED_FBif theXrSpacedoes not support the specified component type.Valid Usage (Implicit)
- The
XR_FB_spatial_entityextension must be enabled prior to callingSetSpaceComponentStatusFB spacemust be a validXrSpacehandleinfomust be a pointer to a validXrSpaceComponentStatusSetInfoFBstructurerequestIdmust be a pointer to anXrAsyncRequestIdFBvalue
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
space- theXrSpacehandle to the spatial entity.info- a pointer to anXrSpaceComponentStatusSetInfoFBstructure containing information about the component to be enabled or disabled.requestId- the output parameter that points to the ID of this asynchronous request.
- The
-
nxrGetSpaceComponentStatusFB
Unsafe version of:GetSpaceComponentStatusFB -
xrGetSpaceComponentStatusFB
public static int xrGetSpaceComponentStatusFB(XrSpace space, int componentType, XrSpaceComponentStatusFB status) Provides the current state of a component.C Specification
The
GetSpaceComponentStatusFBfunction is defined as:XrResult xrGetSpaceComponentStatusFB( XrSpace space, XrSpaceComponentTypeFB componentType, XrSpaceComponentStatusFB* status);Description
Gets the current status of the specified component for the specified entity. This function must return
ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FBif theXrSpacedoes not support the specified component type.Valid Usage (Implicit)
- The
XR_FB_spatial_entityextension must be enabled prior to callingGetSpaceComponentStatusFB spacemust be a validXrSpacehandlecomponentTypemust be a validXrSpaceComponentTypeFBvaluestatusmust be a pointer to anXrSpaceComponentStatusFBstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
space- theXrSpacehandle of a spatial entity.componentType- the component type to query.status- an output parameter pointing to the structure containing the status of the component that was queried.
- The
-