Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class FBSpatialEntity

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

The XR_FB_spatial_entity extension.

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 extensions section.

This extension allows:

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final String
public static final int
XR_FB_spatial_entity_SPEC_VERSION

The extension specification version.

public static final int
XR_SPACE_COMPONENT_TYPE_BOUNDED_2D_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
XR_SPACE_COMPONENT_TYPE_BOUNDED_3D_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
XR_SPACE_COMPONENT_TYPE_LOCATABLE_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
XR_SPACE_COMPONENT_TYPE_SHARABLE_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
XR_SPACE_COMPONENT_TYPE_STORABLE_FB

XrSpaceComponentTypeFB - Component type Description

Specify the component interfaces attached to the spatial entity.

public static final int
public static final int
public static final int
XR_TYPE_SPACE_COMPONENT_STATUS_FB

Extends XrStructureType.

public static final int
public static final int
XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB

Extends XrStructureType.

public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nxrCreateSpatialAnchorFB(XrSession session, long info, long requestId)

Unsafe version of: CreateSpatialAnchorFB

public static int
nxrEnumerateSpaceSupportedComponentsFB(XrSpace space, int
the capacity of the componentTypes array, or 0 to indicate a request to retrieve the required capacity.
componentTypeCapacityInput
,
long componentTypeCountOutput, long componentTypes)

Unsafe version of: EnumerateSpaceSupportedComponentsFB

public static int
nxrGetSpaceComponentStatusFB(XrSpace space, int componentType, long status)

Unsafe version of: GetSpaceComponentStatusFB

public static int
nxrGetSpaceUuidFB(XrSpace space, long uuid)

Unsafe version of: GetSpaceUuidFB

public static int
nxrSetSpaceComponentStatusFB(XrSpace space, long info, long requestId)

Unsafe version of: SetSpaceComponentStatusFB

public static int
xrCreateSpatialAnchorFB(XrSession
a handle to an XrSession.
session
,
XrSpatialAnchorCreateInfoFB
a pointer to an XrSpatialAnchorCreateInfoFB structure containing information about how to create the anchor.
info
,
LongBuffer
the output parameter that points to the ID of this asynchronous request.
requestId
)

Creates a new spatial anchor.

public static int
xrEnumerateSpaceSupportedComponentsFB(XrSpace
the XrSpace handle to the spatial entity.
space
,
IntBuffer
a pointer to the count of componentTypes written, or a pointer to the required capacity in the case that componentTypeCapacityInput is insufficient.
componentTypeCountOutput
,
IntBuffer
a pointer to an array of XrSpaceComponentTypeFB values, but can be NULL if componentTypeCapacityInput is 0.
componentTypes
)

Enumerates supported components for a given spatial entity.

public static int
xrGetSpaceComponentStatusFB(XrSpace
the XrSpace handle of a spatial entity.
space
,
int
the component type to query.
componentType
,
XrSpaceComponentStatusFB
an output parameter pointing to the structure containing the status of the component that was queried.
status
)

Provides the current state of a component.

public static int
xrGetSpaceUuidFB(XrSpace
the XrSpace handle of a spatial entity.
space
,
XrUuidEXT
an output parameter pointing to the entity’s UUID.
uuid
)

Gets an entity.

public static int
xrSetSpaceComponentStatusFB(XrSpace
the XrSpace handle to the spatial entity.
space
,
XrSpaceComponentStatusSetInfoFB
a pointer to an XrSpaceComponentStatusSetInfoFB structure containing information about the component to be enabled or disabled.
info
,
LongBuffer
the output parameter that points to the ID of this asynchronous request.
requestId
)

Enables or disables supported component interfaces for an entity.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FBback to summary
public static final int XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FB

Extends XrResult.

Enum values:
XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FBback to summary
public static final int XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FB

Extends XrResult.

Enum values:
XR_ERROR_SPACE_COMPONENT_STATUS_ALREADY_SET_FBback to summary
public static final int XR_ERROR_SPACE_COMPONENT_STATUS_ALREADY_SET_FB

Extends XrResult.

Enum values:
XR_ERROR_SPACE_COMPONENT_STATUS_PENDING_FBback to summary
public static final int XR_ERROR_SPACE_COMPONENT_STATUS_PENDING_FB

Extends XrResult.

Enum values:
XR_FB_SPATIAL_ENTITY_EXTENSION_NAMEback to summary
public static final String XR_FB_SPATIAL_ENTITY_EXTENSION_NAME

The extension name.

XR_FB_spatial_entity_SPEC_VERSIONback to summary
public static final int XR_FB_spatial_entity_SPEC_VERSION

The extension specification version.

XR_SPACE_COMPONENT_TYPE_BOUNDED_2D_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_BOUNDED_2D_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_SPACE_COMPONENT_TYPE_BOUNDED_3D_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_BOUNDED_3D_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_SPACE_COMPONENT_TYPE_LOCATABLE_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_LOCATABLE_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_SPACE_COMPONENT_TYPE_SHARABLE_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_SHARABLE_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_SPACE_COMPONENT_TYPE_STORABLE_FBback to summary
public static final int XR_SPACE_COMPONENT_TYPE_STORABLE_FB

XrSpaceComponentTypeFB - Component type

Description

Specify the component interfaces attached to the spatial entity.

Enumerant Descriptions
See Also

XrEventDataSpaceSetStatusCompleteFB, XrSpaceComponentFilterInfoFB, XrSpaceComponentStatusSetInfoFB, EnumerateSpaceSupportedComponentsFB, GetSpaceComponentStatusFB

XR_TYPE_EVENT_DATA_SPACE_SET_STATUS_COMPLETE_FBback to summary
public static final int XR_TYPE_EVENT_DATA_SPACE_SET_STATUS_COMPLETE_FB

Extends XrStructureType.

Enum values:
XR_TYPE_EVENT_DATA_SPATIAL_ANCHOR_CREATE_COMPLETE_FBback to summary
public static final int XR_TYPE_EVENT_DATA_SPATIAL_ANCHOR_CREATE_COMPLETE_FB

Extends XrStructureType.

Enum values:
XR_TYPE_SPACE_COMPONENT_STATUS_FBback to summary
public static final int XR_TYPE_SPACE_COMPONENT_STATUS_FB

Extends XrStructureType.

Enum values:
XR_TYPE_SPACE_COMPONENT_STATUS_SET_INFO_FBback to summary
public static final int XR_TYPE_SPACE_COMPONENT_STATUS_SET_INFO_FB

Extends XrStructureType.

Enum values:
XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FBback to summary
public static final int XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB

Extends XrStructureType.

Enum values:
XR_TYPE_SYSTEM_SPATIAL_ENTITY_PROPERTIES_FBback to summary
public static final int XR_TYPE_SYSTEM_SPATIAL_ENTITY_PROPERTIES_FB

Extends XrStructureType.

Enum values:

Constructor Detail

FBSpatialEntityback to summary
protected FBSpatialEntity()

Method Detail

nxrCreateSpatialAnchorFBback to summary
public static int nxrCreateSpatialAnchorFB(XrSession session, long info, long requestId)

Unsafe version of: CreateSpatialAnchorFB

nxrEnumerateSpaceSupportedComponentsFBback to summary
public static int nxrEnumerateSpaceSupportedComponentsFB(XrSpace space, int componentTypeCapacityInput, long componentTypeCountOutput, long componentTypes)

Unsafe version of: EnumerateSpaceSupportedComponentsFB

Parameters
componentTypeCapacityInput:int

the capacity of the componentTypes array, or 0 to indicate a request to retrieve the required capacity.

nxrGetSpaceComponentStatusFBback to summary
public static int nxrGetSpaceComponentStatusFB(XrSpace space, int componentType, long status)

Unsafe version of: GetSpaceComponentStatusFB

nxrGetSpaceUuidFBback to summary
public static int nxrGetSpaceUuidFB(XrSpace space, long uuid)

Unsafe version of: GetSpaceUuidFB

nxrSetSpaceComponentStatusFBback to summary
public static int nxrSetSpaceComponentStatusFB(XrSpace space, long info, long requestId)

Unsafe version of: SetSpaceComponentStatusFB

xrCreateSpatialAnchorFBback to summary
public static int xrCreateSpatialAnchorFB(XrSession session, XrSpatialAnchorCreateInfoFB info, LongBuffer requestId)

Creates a new spatial anchor.

C Specification

The CreateSpatialAnchorFB function 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 LocateSpace method. This operation is asynchronous and the runtime must post an XrEventDataSpatialAnchorCreateCompleteFB event when the operation completes successfully or encounters an error. If this function returns a failure code, no event is posted. The requestId can be used to later refer to the request, such as identifying which request has completed when an XrEventDataSpatialAnchorCreateCompleteFB is posted to the event queue.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpatialAnchorCreateInfoFB

Parameters
session:XrSession

a handle to an XrSession.

info:XrSpatialAnchorCreateInfoFB

a pointer to an XrSpatialAnchorCreateInfoFB structure containing information about how to create the anchor.

requestId:LongBuffer

the output parameter that points to the ID of this asynchronous request.

Annotations
@NativeType:XrResult
xrEnumerateSpaceSupportedComponentsFBback to summary
public static int xrEnumerateSpaceSupportedComponentsFB(XrSpace space, IntBuffer componentTypeCountOutput, IntBuffer componentTypes)

Enumerates supported components for a given spatial entity.

C Specification

The EnumerateSpaceSupportedComponentsFB function 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_entity extension must be enabled prior to calling EnumerateSpaceSupportedComponentsFB
  • space must be a valid XrSpace handle
  • componentTypeCountOutput must be a pointer to a uint32_t value
  • If componentTypeCapacityInput is not 0, componentTypes must be a pointer to an array of componentTypeCapacityInput XrSpaceComponentTypeFB values
Return Codes
On success, this command returns
On failure, this command returns
Parameters
space:XrSpace

the XrSpace handle to the spatial entity.

componentTypeCountOutput:IntBuffer

a pointer to the count of componentTypes written, or a pointer to the required capacity in the case that componentTypeCapacityInput is insufficient.

componentTypes:IntBuffer

a pointer to an array of XrSpaceComponentTypeFB values, but can be NULL if componentTypeCapacityInput is 0.

Annotations
@NativeType:XrResult
xrGetSpaceComponentStatusFBback to summary
public static int xrGetSpaceComponentStatusFB(XrSpace space, int componentType, XrSpaceComponentStatusFB status)

Provides the current state of a component.

C Specification

The GetSpaceComponentStatusFB function 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_FB if the XrSpace does not support the specified component type.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpaceComponentStatusFB

Parameters
space:XrSpace

the XrSpace handle of a spatial entity.

componentType:int

the component type to query.

status:XrSpaceComponentStatusFB

an output parameter pointing to the structure containing the status of the component that was queried.

Annotations
@NativeType:XrResult
xrGetSpaceUuidFBback to summary
public static int xrGetSpaceUuidFB(XrSpace space, XrUuidEXT uuid)

Gets an entity.

C Specification

The GetSpaceUuidFB function 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, uuid must be equal to the XrEventDataSpatialAnchorCreateCompleteFB::uuid in the event corresponding to the creation of that space. Subsequent calls to GetSpaceUuidFB using the same XrSpace must return the same XrUuidEXT.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrUuidEXT

Parameters
space:XrSpace

the XrSpace handle of a spatial entity.

uuid:XrUuidEXT

an output parameter pointing to the entity’s UUID.

Annotations
@NativeType:XrResult
xrSetSpaceComponentStatusFBback to summary
public static int xrSetSpaceComponentStatusFB(XrSpace space, XrSpaceComponentStatusSetInfoFB info, LongBuffer requestId)

Enables or disables supported component interfaces for an entity.

C Specification

The SetSpaceComponentStatusFB function 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 timeout. The requestId can be used to later refer to the request, such as identifying which request has completed when an XrEventDataSpaceSetStatusCompleteFB is posted to the event queue. If this function returns a failure code, no event is posted. This function must return ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FB if the XrSpace does not support the specified component type.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpaceComponentStatusSetInfoFB

Parameters
space:XrSpace

the XrSpace handle to the spatial entity.

info:XrSpaceComponentStatusSetInfoFB

a pointer to an XrSpaceComponentStatusSetInfoFB structure containing information about the component to be enabled or disabled.

requestId:LongBuffer

the output parameter that points to the ID of this asynchronous request.

Annotations
@NativeType:XrResult