Class XRReferencePointSubsystem
Base class for a reference point subsystem.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Syntax
public abstract class XRReferencePointSubsystem : TrackingSubsystem<XRReferencePoint, XRReferencePointSubsystemDescriptor>
Remarks
A reference point is a pose in the physical environment that is tracked by an XR device. As the device refines its understanding of the environment, reference points will be updated, allowing developers to keep virtual content connected to a real-world position and orientation.
This abstract class should be implemented by an XR provider and instantiated using the SubsystemManager
to enumerate the available XRReferencePointSubsystemDescriptors.
Constructors
XRReferencePointSubsystem()
Constructor. Do not invoke directly; use the SubsystemManager
to enumerate the available XRReferencePointSubsystemDescriptors
and call Create
on the desired descriptor.
Declaration
public XRReferencePointSubsystem()
Methods
CreateProvider()
Should return an instance of XRReferencePointSubsystem.IProvider.
Declaration
protected abstract XRReferencePointSubsystem.IProvider CreateProvider()
Returns
Type | Description |
---|---|
XRReferencePointSubsystem.IProvider | The interface to the implementation-specific provider. |
Destroy()
Destroys the subsystem.
Declaration
public sealed override void Destroy()
GetChanges(Allocator)
Declaration
public override TrackableChanges<XRReferencePoint> GetChanges(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator |
Returns
Type | Description |
---|---|
TrackableChanges<XRReferencePoint> |
Overrides
Start()
Starts the subsystem.
Declaration
public override void Start()
Stop()
Stops the subsystem.
Declaration
public override void Stop()
TryAddReferencePoint(Pose, out XRReferencePoint)
Attempts to create a new reference point with the provide pose
.
Declaration
public bool TryAddReferencePoint(Pose pose, out XRReferencePoint referencePoint)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The pose, in session space, of the new reference point. |
XRReferencePoint | referencePoint | The new reference point. Only valid if this method returns |
Returns
Type | Description |
---|---|
Boolean |
|
TryAttachReferencePoint(TrackableId, Pose, out XRReferencePoint)
Attempts to create a new reference "attached" to the trackable with id trackableToAffix
.
The behavior of the reference point depends on the type of trackable to which this reference point is attached.
Declaration
public bool TryAttachReferencePoint(TrackableId trackableToAffix, Pose pose, out XRReferencePoint referencePoint)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableToAffix | The id of the trackable to which to attach. |
Pose | pose | The pose, in session space, of the reference point to create. |
XRReferencePoint | referencePoint | The new reference point. Only valid if this method returns |
Returns
Type | Description |
---|---|
Boolean |
|
TryRemoveReferencePoint(TrackableId)
Attempts to remove an existing reference point with TrackableId referencePointId
.
Declaration
public bool TryRemoveReferencePoint(TrackableId referencePointId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | referencePointId | The id of an existing reference point to remove. |
Returns
Type | Description |
---|---|
Boolean |
|