API reference
API reference
Select your platform
No SDKs available
No versions available

FOculusXRAnchors Struct

Main interface for OculusXR anchor operations. This struct provides static methods for all anchor-related functionality including creation, persistence, querying, sharing, and lifecycle management. Uses the singleton pattern for internal state management.

Member Functions

HasAnchorQueryBinding ( RequestId )
Signature
bool OculusXRAnchors::FOculusXRAnchors::HasAnchorQueryBinding(uint64 RequestId) const
Parameters
RequestId: uint64
Returns
bool
HasDiscoveryBinding ( RequestId )
Signature
bool OculusXRAnchors::FOculusXRAnchors::HasDiscoveryBinding(uint64 RequestId) const
Parameters
RequestId: uint64
Returns
bool
Initialize ()
Initializes the anchor system and sets up internal state. Must be called before using any other anchor functionality.
Signature
void OculusXRAnchors::FOculusXRAnchors::Initialize()
Returns
void
Teardown ()
Cleans up the anchor system and releases resources. Should be called when anchor functionality is no longer needed.
Signature
void OculusXRAnchors::FOculusXRAnchors::Teardown()
Returns
void

Static Member Functions

CreateSpatialAnchor ( InTransform , TargetActor , ResultCallback , OutResult )
Creates a new spatial anchor at the specified transform.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::CreateSpatialAnchor(const FTransform &InTransform, AActor *TargetActor, const FOculusXRSpatialAnchorCreateDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
InTransform: const FTransform &  The world transform where the anchor should be created
TargetActor: AActor *  The actor to attach the anchor component to
ResultCallback: const FOculusXRSpatialAnchorCreateDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
DestroyAnchor ( AnchorHandle , OutResult )
Destroys an anchor by handle, removing it from the current session.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::DestroyAnchor(uint64 AnchorHandle, EOculusXRAnchorResult::Type &OutResult)
Parameters
AnchorHandle: uint64  Handle of the anchor to destroy
OutResult: EOculusXRAnchorResult::Type &  Result of the destroy operation
Returns
bool  True if the anchor was successfully destroyed
DiscoverAnchors ( DiscoveryInfo , DiscoveryResultsCallback , DiscoveryCompleteCallback , OutResult )
Discovers anchors based on discovery criteria.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::DiscoverAnchors(const FOculusXRSpaceDiscoveryInfo &DiscoveryInfo, const FOculusXRDiscoverAnchorsResultsDelegate &DiscoveryResultsCallback, const FOculusXRDiscoverAnchorsCompleteDelegate &DiscoveryCompleteCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
DiscoveryInfo: const FOculusXRSpaceDiscoveryInfo &  Parameters for the discovery operation
DiscoveryResultsCallback: const FOculusXRDiscoverAnchorsResultsDelegate &  Delegate called when results are found
DiscoveryCompleteCallback: const FOculusXRDiscoverAnchorsCompleteDelegate &  Delegate called when discovery completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
EraseAnchor ( Anchor , ResultCallback , OutResult )
Erases an anchor from storage.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::EraseAnchor(UOculusXRAnchorComponent *Anchor, const FOculusXRAnchorEraseDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchor: UOculusXRAnchorComponent *  The anchor component to erase
ResultCallback: const FOculusXRAnchorEraseDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
EraseAnchors ( Anchors , ResultCallback , OutResult )
Erases multiple anchors using batch operation by components.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::EraseAnchors(const TArray< UOculusXRAnchorComponent * > &Anchors, const FOculusXREraseAnchorsDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchors: const TArray< UOculusXRAnchorComponent * > &  Array of anchor components to erase
ResultCallback: const FOculusXREraseAnchorsDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
EraseAnchors ( AnchorHandles , AnchorUUIDs , ResultCallback , OutResult )
Erases multiple anchors using batch operation by handles and UUIDs.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::EraseAnchors(const TArray< FOculusXRUInt64 > &AnchorHandles, const TArray< FOculusXRUUID > &AnchorUUIDs, const FOculusXREraseAnchorsDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
AnchorHandles: const TArray< FOculusXRUInt64 > &  Array of anchor handles to erase
AnchorUUIDs: const TArray< FOculusXRUUID > &  Array of anchor UUIDs to erase
ResultCallback: const FOculusXREraseAnchorsDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
GetAnchorComponentStatus ( Anchor , SpaceComponentType , OutEnabled , OutChangePending , OutResult )
Gets the current status of a specific component on an anchor.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::GetAnchorComponentStatus(UOculusXRAnchorComponent *Anchor, EOculusXRSpaceComponentType SpaceComponentType, bool &OutEnabled, bool &OutChangePending, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchor: UOculusXRAnchorComponent *  The anchor to query
SpaceComponentType: EOculusXRSpaceComponentType  Type of component to check
OutEnabled: bool &  Whether the component is currently enabled
OutChangePending: bool &  Whether a status change is pending
OutResult: EOculusXRAnchorResult::Type &  Result of the query operation
Returns
bool  True if the query was successful
GetAnchorSupportedComponents ( Anchor , OutSupportedComponents , OutResult )
Gets all supported component types for an anchor.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::GetAnchorSupportedComponents(UOculusXRAnchorComponent *Anchor, TArray< EOculusXRSpaceComponentType > &OutSupportedComponents, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchor: UOculusXRAnchorComponent *  The anchor to query
OutSupportedComponents: TArray< EOculusXRSpaceComponentType > &  Array of supported component types
OutResult: EOculusXRAnchorResult::Type &  Result of the query operation
Returns
bool  True if the query was successful
GetComponentStatus ( AnchorHandle , SpaceComponentType , OutEnabled , OutChangePending , OutResult )
Gets the current status of a specific component on a space by handle.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::GetComponentStatus(uint64 AnchorHandle, EOculusXRSpaceComponentType SpaceComponentType, bool &OutEnabled, bool &OutChangePending, EOculusXRAnchorResult::Type &OutResult)
Parameters
AnchorHandle: uint64  Handle of the anchor to query
SpaceComponentType: EOculusXRSpaceComponentType  Type of component to check
OutEnabled: bool &  Whether the component is currently enabled
OutChangePending: bool &  Whether a status change is pending
OutResult: EOculusXRAnchorResult::Type &  Result of the query operation
Returns
bool  True if the query was successful
GetInstance ()
Gets the singleton instance of the anchor system.
Signature
static FOculusXRAnchors * OculusXRAnchors::FOculusXRAnchors::GetInstance()
Returns
FOculusXRAnchors *  Pointer to the singleton instance
GetSharedAnchors ( AnchorUUIDs , ResultCallback , OutResult )
Gets anchors that have been shared with the current user.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::GetSharedAnchors(const TArray< FOculusXRUUID > &AnchorUUIDs, const FOculusXRGetSharedAnchorsDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
AnchorUUIDs: const TArray< FOculusXRUUID > &  Array of anchor UUIDs to retrieve
ResultCallback: const FOculusXRGetSharedAnchorsDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
GetSharedAnchorsAsync ( Group , WantedAnchors , OnComplete )
Asynchronously gets anchors shared with a specific group.
Signature
static TSharedPtr< FGetAnchorsSharedWithGroup > OculusXRAnchors::FOculusXRAnchors::GetSharedAnchorsAsync(const FOculusXRUUID &Group, const TArray< FOculusXRUUID > &WantedAnchors, const FGetAnchorsSharedWithGroup::FCompleteDelegate &OnComplete)
Parameters
Group: const FOculusXRUUID &  UUID of the group to query
WantedAnchors: const TArray< FOculusXRUUID > &  Array of specific anchor UUIDs to retrieve
OnComplete: const FGetAnchorsSharedWithGroup::FCompleteDelegate &  Delegate called when the operation completes
Returns
TSharedPtr< FGetAnchorsSharedWithGroup >  Shared pointer to the async operation for tracking
GetSpaceContainerUUIDs ( Space , OutUUIDs , OutResult )
Gets the UUIDs of all spaces contained within a space container.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::GetSpaceContainerUUIDs(uint64 Space, TArray< FOculusXRUUID > &OutUUIDs, EOculusXRAnchorResult::Type &OutResult)
Parameters
Space: uint64  Handle of the container space
OutUUIDs: TArray< FOculusXRUUID > &  Array to receive the contained space UUIDs
OutResult: EOculusXRAnchorResult::Type &  Result of the operation
Returns
bool  True if the operation was successful
GetSupportedComponents ( AnchorHandle , OutSupportedComponents , OutResult )
Gets all supported component types for a space by handle.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::GetSupportedComponents(uint64 AnchorHandle, TArray< EOculusXRSpaceComponentType > &OutSupportedComponents, EOculusXRAnchorResult::Type &OutResult)
Parameters
AnchorHandle: uint64  Handle of the anchor to query
OutSupportedComponents: TArray< EOculusXRSpaceComponentType > &  Array of supported component types
OutResult: EOculusXRAnchorResult::Type &  Result of the query operation
Returns
bool  True if the query was successful
QueryAnchors ( AnchorUUIDs , Location , ResultCallback , OutResult )
Queries for anchors by their UUIDs from the specified storage location.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::QueryAnchors(const TArray< FOculusXRUUID > &AnchorUUIDs, EOculusXRSpaceStorageLocation Location, const FOculusXRAnchorQueryDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
AnchorUUIDs: const TArray< FOculusXRUUID > &  Array of anchor UUIDs to search for
Location: EOculusXRSpaceStorageLocation  Storage location to search in
ResultCallback: const FOculusXRAnchorQueryDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
QueryAnchorsAdvanced ( QueryInfo , ResultCallback , OutResult )
Performs an advanced anchor query with custom search parameters.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::QueryAnchorsAdvanced(const FOculusXRSpaceQueryInfo &QueryInfo, const FOculusXRAnchorQueryDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
QueryInfo: const FOculusXRSpaceQueryInfo &  Advanced query parameters and filters
ResultCallback: const FOculusXRAnchorQueryDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
SaveAnchor ( Anchor , StorageLocation , ResultCallback , OutResult )
Saves a single anchor to the specified storage location.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::SaveAnchor(UOculusXRAnchorComponent *Anchor, EOculusXRSpaceStorageLocation StorageLocation, const FOculusXRAnchorSaveDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchor: UOculusXRAnchorComponent *  The anchor to save
StorageLocation: EOculusXRSpaceStorageLocation  Where to save the anchor (local or cloud)
ResultCallback: const FOculusXRAnchorSaveDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
SaveAnchorList ( Anchors , StorageLocation , ResultCallback , OutResult )
Saves multiple anchors to the specified storage location.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::SaveAnchorList(const TArray< UOculusXRAnchorComponent * > &Anchors, EOculusXRSpaceStorageLocation StorageLocation, const FOculusXRAnchorSaveListDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchors: const TArray< UOculusXRAnchorComponent * > &  Array of anchors to save
StorageLocation: EOculusXRSpaceStorageLocation  Where to save the anchors (local or cloud)
ResultCallback: const FOculusXRAnchorSaveListDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
SaveAnchors ( Anchors , ResultCallback , OutResult )
Saves multiple anchors using batch operation.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::SaveAnchors(const TArray< UOculusXRAnchorComponent * > &Anchors, const FOculusXRSaveAnchorsDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchors: const TArray< UOculusXRAnchorComponent * > &  Array of anchor components to save
ResultCallback: const FOculusXRSaveAnchorsDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
SetAnchorComponentStatus ( Anchor , SpaceComponentType , Enable , Timeout , ResultCallback , OutResult )
Sets the status of a specific component on an anchor.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::SetAnchorComponentStatus(UOculusXRAnchorComponent *Anchor, EOculusXRSpaceComponentType SpaceComponentType, bool Enable, float Timeout, const FOculusXRAnchorSetComponentStatusDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchor: UOculusXRAnchorComponent *  The anchor to modify
SpaceComponentType: EOculusXRSpaceComponentType  Type of component to enable/disable
Enable: bool  Whether to enable or disable the component
Timeout: float  Timeout for the operation in seconds
ResultCallback: const FOculusXRAnchorSetComponentStatusDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
SetComponentStatus ( Space , SpaceComponentType , Enable , Timeout , ResultCallback , OutResult )
Sets the status of a specific component on a space by handle.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::SetComponentStatus(uint64 Space, EOculusXRSpaceComponentType SpaceComponentType, bool Enable, float Timeout, const FOculusXRAnchorSetComponentStatusDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Space: uint64  Handle of the space to modify
SpaceComponentType: EOculusXRSpaceComponentType  Type of component to enable/disable
Enable: bool  Whether to enable or disable the component
Timeout: float  Timeout for the operation in seconds
ResultCallback: const FOculusXRAnchorSetComponentStatusDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
ShareAnchors ( Anchors , OculusUserIDs , ResultCallback , OutResult )
Shares anchors with specified users by anchor components.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::ShareAnchors(const TArray< UOculusXRAnchorComponent * > &Anchors, const TArray< uint64 > &OculusUserIDs, const FOculusXRAnchorShareDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
Anchors: const TArray< UOculusXRAnchorComponent * > &  Array of anchor components to share
OculusUserIDs: const TArray< uint64 > &  Array of Oculus user IDs to share with
ResultCallback: const FOculusXRAnchorShareDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
ShareAnchors ( AnchorHandles , OculusUserIDs , ResultCallback , OutResult )
Shares anchors with specified users by anchor handles.
Signature
static bool OculusXRAnchors::FOculusXRAnchors::ShareAnchors(const TArray< uint64 > &AnchorHandles, const TArray< uint64 > &OculusUserIDs, const FOculusXRAnchorShareDelegate &ResultCallback, EOculusXRAnchorResult::Type &OutResult)
Parameters
AnchorHandles: const TArray< uint64 > &  Array of anchor handles to share
OculusUserIDs: const TArray< uint64 > &  Array of Oculus user IDs to share with
ResultCallback: const FOculusXRAnchorShareDelegate &  Delegate called when the operation completes
OutResult: EOculusXRAnchorResult::Type &  Immediate result of the operation request
Returns
bool  True if the request was successfully submitted
ShareAnchorsAsync ( AnchorHandles , Groups , OnComplete )
Asynchronously shares anchors with groups.
Signature
static TSharedPtr< FShareAnchorsWithGroups > OculusXRAnchors::FOculusXRAnchors::ShareAnchorsAsync(const TArray< FOculusXRUInt64 > &AnchorHandles, const TArray< FOculusXRUUID > &Groups, const FShareAnchorsWithGroups::FCompleteDelegate &OnComplete)
Parameters
AnchorHandles: const TArray< FOculusXRUInt64 > &  Array of anchor handles to share
Groups: const TArray< FOculusXRUUID > &  Array of group UUIDs to share with
OnComplete: const FShareAnchorsWithGroups::FCompleteDelegate &  Delegate called when the operation completes
Returns
TSharedPtr< FShareAnchorsWithGroups >  Shared pointer to the async operation for tracking