Class XREnvironmentProbeSubsystem
Defines an interface for interacting with environment probe functionality for creating realistic lighting and environment texturing in AR scenes.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Syntax
public abstract class XREnvironmentProbeSubsystem : TrackingSubsystem<XREnvironmentProbe, XREnvironmentProbeSubsystemDescriptor>
Constructors
XREnvironmentProbeSubsystem()
Constructs an XREnvironmentProbeSubsystem.
Do not create this directly.
Call Create
on an XREnvironmentProbeSubsystemDescriptor obtained from the SubsystemManager
.
Declaration
public XREnvironmentProbeSubsystem()
Properties
automaticPlacement
Specifies whether the AR session should automatically place environment probes in the scene.
Declaration
public bool automaticPlacement { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Remarks
If both manual and automatic placement of environment probes are supported, manually placed environment
probes may be specified via
supported
Use this to determine runtime support for environment probes as support may be device or OS version specific.
Declaration
public bool supported { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
CreateProvider()
Must create an implementation of XREnvironmentProbeSubsystem.IProvider, the provider-specific implementation of this subsystem.
Declaration
protected abstract XREnvironmentProbeSubsystem.IProvider CreateProvider()
Returns
Type | Description |
---|---|
XREnvironmentProbeSubsystem.IProvider |
Destroy()
Destroys the subsystem and any internal state.
Declaration
public sealed override void Destroy()
GetChanges(Allocator)
Declaration
public override TrackableChanges<XREnvironmentProbe> GetChanges(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator |
Returns
Type | Description |
---|---|
TrackableChanges<XREnvironmentProbe> |
Overrides
Register(XREnvironmentProbeSubsystemCinfo)
Registers a subsystem implementation based on the given subystem parameters.
Declaration
public static bool Register(XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo)
Parameters
Type | Name | Description |
---|---|---|
XREnvironmentProbeSubsystemCinfo | environmentProbeSubsystemCinfo | The parameters defining the environment probe functionality implemented by the subsystem provider. |
Returns
Type | Description |
---|---|
Boolean |
|
RemoveEnvironmentProbe(TrackableId)
Asynchronously removes the environment probe matching the trackable ID from the AR session.
Declaration
public bool RemoveEnvironmentProbe(TrackableId trackableId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | Trackable ID of the environment probe to be removed from the AR session. |
Returns
Type | Description |
---|---|
Boolean |
|
Remarks
RemoveEnvironmentProbe
may be used to remove both manually-placed and automatically-placed
environment probes if the implementation supports such removals, as indicated by the descriptor properties
supportsRemovalOfManual and
supportsRemovalOfAutomatic.
Start()
Starts the subsystem. If automaticPlacement is true
, environment probes will be created automatically.
Declaration
public override void Start()
Stop()
Stops the subsystem. This does not remove existing environment probes, but it stops automatically placing them, and manually placed probes will not be updated until Start() is called again.
Declaration
public override void Stop()
TryAddEnvironmentProbe(Pose, Vector3, Vector3, out XREnvironmentProbe)
Tries to create an environment probe.
Declaration
public bool TryAddEnvironmentProbe(Pose pose, Vector3 scale, Vector3 size, out XREnvironmentProbe environmentProbe)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The position and rotation at which to create the environment probe. |
Vector3 | scale | The scale at which to create the environment probe. |
Vector3 | size | The size (dimensions) of the environment probe to create. |
XREnvironmentProbe | environmentProbe | If successful, populated with the newly created environment probe. Otherwise, it will contain default values. |
Returns
Type | Description |
---|---|
Boolean |
|