Edit

Share via


WindowsSceneUnderstandingObserver Class

Definition

A Spatial Awareness observer with Scene Understanding capabilities.

public ref class WindowsSceneUnderstandingObserver : Microsoft::MixedReality::Toolkit::SpatialAwareness::BaseSpatialObserver, IDisposable, Microsoft::MixedReality::Toolkit::Experimental::SpatialAwareness::IMixedRealitySceneUnderstandingObserver, System::Collections::IEqualityComparer
[Microsoft.MixedReality.Toolkit.MixedRealityDataProvider(typeof(Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessSystem), Microsoft.MixedReality.Toolkit.Utilities.SupportedPlatforms.WindowsUniversal, "Windows Scene Understanding Observer", "Experimental/WindowsSceneUnderstanding/Profiles/DefaultSceneUnderstandingObserverProfile.asset", "MixedRealityToolkit.Providers", true)]
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/spatial-awareness/scene-understanding")]
public class WindowsSceneUnderstandingObserver : Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver, IDisposable, Microsoft.MixedReality.Toolkit.Experimental.SpatialAwareness.IMixedRealitySceneUnderstandingObserver, System.Collections.IEqualityComparer
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/spatial-awareness/scene-understanding")]
[Microsoft.MixedReality.Toolkit.MixedRealityDataProvider(typeof(Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessSystem), Microsoft.MixedReality.Toolkit.Utilities.SupportedPlatforms.WindowsUniversal, "Windows Scene Understanding Observer", "Experimental/WindowsSceneUnderstanding/Profiles/DefaultSceneUnderstandingObserverProfile.asset", "MixedRealityToolkit.Providers", true, Microsoft.MixedReality.Toolkit.Utilities.SupportedUnityXRPipelines.LegacyXR | Microsoft.MixedReality.Toolkit.Utilities.SupportedUnityXRPipelines.XRSDK)]
public class WindowsSceneUnderstandingObserver : Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver, IDisposable, Microsoft.MixedReality.Toolkit.Experimental.SpatialAwareness.IMixedRealitySceneUnderstandingObserver, System.Collections.IEqualityComparer
[<Microsoft.MixedReality.Toolkit.MixedRealityDataProvider(typeof(Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessSystem), Microsoft.MixedReality.Toolkit.Utilities.SupportedPlatforms.WindowsUniversal, "Windows Scene Understanding Observer", "Experimental/WindowsSceneUnderstanding/Profiles/DefaultSceneUnderstandingObserverProfile.asset", "MixedRealityToolkit.Providers", true)>]
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/spatial-awareness/scene-understanding")>]
type WindowsSceneUnderstandingObserver = class
    inherit BaseSpatialObserver
    interface IMixedRealitySceneUnderstandingObserver
    interface IMixedRealityOnDemandObserver
    interface IMixedRealitySpatialAwarenessObserver
    interface IMixedRealityDataProvider
    interface IMixedRealityService
    interface IDisposable
    interface IMixedRealityEventSource
    interface IEqualityComparer
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/spatial-awareness/scene-understanding")>]
[<Microsoft.MixedReality.Toolkit.MixedRealityDataProvider(typeof(Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessSystem), Microsoft.MixedReality.Toolkit.Utilities.SupportedPlatforms.WindowsUniversal, "Windows Scene Understanding Observer", "Experimental/WindowsSceneUnderstanding/Profiles/DefaultSceneUnderstandingObserverProfile.asset", "MixedRealityToolkit.Providers", true, Microsoft.MixedReality.Toolkit.Utilities.SupportedUnityXRPipelines.LegacyXR | Microsoft.MixedReality.Toolkit.Utilities.SupportedUnityXRPipelines.XRSDK)>]
type WindowsSceneUnderstandingObserver = class
    inherit BaseSpatialObserver
    interface IMixedRealitySceneUnderstandingObserver
    interface IMixedRealityOnDemandObserver
    interface IMixedRealitySpatialAwarenessObserver
    interface IMixedRealityDataProvider
    interface IMixedRealityService
    interface IDisposable
    interface IMixedRealityEventSource
    interface IEqualityComparer
Public Class WindowsSceneUnderstandingObserver
Inherits BaseSpatialObserver
Implements IDisposable, IEqualityComparer, IMixedRealitySceneUnderstandingObserver
Inheritance
Attributes
MixedRealityDataProviderAttribute UnityEngine.HelpURLAttribute
Implements

Remarks

Only works with HoloLens 2 and Unity 2019.4+

Constructors

WindowsSceneUnderstandingObserver(IMixedRealitySpatialAwarenessSystem, String, UInt32, BaseMixedRealityProfile)

Constructor.

Fields

DefaultPriority (Inherited from BaseService)
DefaultSpatialAwarenessLayer

Default dedicated layer for spatial awareness layer used by most components in MRTK

(Inherited from BaseSpatialObserver)
disposed

Value indicating if the object has completed disposal.

(Inherited from BaseService)

Properties

AutoUpdate

Whether the observer updates its observations automatically on interval.

ConfigurationProfile

The configuration profile for the service.

(Inherited from BaseService)
CreateGameObjects System.Object.CreateGameObjects
DefaultMaterial
DefaultPhysicsLayer

Get or sets the default Unity Physics Layer on which to set the spatial object.

(Inherited from BaseSpatialObserver)
DefaultWorldMeshMaterial
FirstAutoUpdateDelay

Delay in seconds before the observer starts to update automatically for the first time after initialization

InferRegions

When enabled, generates data for observed and inferred regions in the scene. When disabled, generates data only for observed regions in the scene.

InstantiationBatchRate

Number of meshes to generate per frame. Throttled to keep framerate under control.

IsEnabled

Indicates whether or not the service is currently enabled.

(Inherited from BaseService)
IsInitialized

Indicates whether or not the service has been initialized.

(Inherited from BaseService)
IsMarkedDestroyed

Indicates whether or not the Destroy method been called on this service.

(Inherited from BaseService)
IsRunning

Is the observer running (actively accumulating spatial data)?

(Inherited from BaseSpatialObserver)
IsStationaryObserver

Should the observer remain stationary in the scene?

(Inherited from BaseSpatialObserver)
Name

Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action.

(Inherited from BaseService)
ObservationExtents

Gets or sets the extents (1/2 size) of the volume, in meters per axis, from which individual observations will be made.

(Inherited from BaseSpatialObserver)
ObservationParent

The parent GameObject for all observed meshes to be placed under.

(Inherited from BaseSpatialObserver)
ObservedObjectParent (Inherited from BaseSpatialObserver)
ObserverOrigin

Gets or sets the origin, in world space, of the observer.

(Inherited from BaseSpatialObserver)
ObserverRotation

Gets or sets the orientation of the volume in world space.

(Inherited from BaseSpatialObserver)
ObserverVolumeType

Gets or sets the type of volume the observer should operate in.

(Inherited from BaseSpatialObserver)
OcclusionMaskResolution System.Object.OcclusionMaskResolution
OrientScene System.Object.OrientScene
Priority

Optional Priority to reorder registered managers based on their respective priority, reduces the risk of race conditions by prioritizing the order in which managers are evaluated.

(Inherited from BaseService)
QueryRadius

The distance infer surface understanding

Registrar
Obsolete.

The service registrar instance that registered this service.

(Inherited from BaseDataProvider<T>)
RequestMeshData

When enabled, the service will provide surface meshes.

RequestOcclusionMask

When enabled, the service will generate texture data for suitable for spatial queries

RequestPlaneData

When enabled, the service will provide surface planes, represented as a quad.

SceneObjects

The set of SpatialAwarenessSceneObjects being managed by the observer, keyed by a unique id.

SerializedScene

The saved scene understanding file

Service

The service instance to which this provider is providing data.

(Inherited from BaseDataProvider<T>)
ShouldLoadFromFile System.Object.ShouldLoadFromFile
SourceId

The unique source id of this event source.

(Inherited from BaseSpatialObserver)
SourceName

The name of this event source.

(Inherited from BaseSpatialObserver)
SpatialAwarenessSystem
Obsolete.

The spatial awareness system that is associated with this observer.

(Inherited from BaseSpatialObserver)
StartupBehavior

Indicates the developer's intended startup behavior.

(Inherited from BaseSpatialObserver)
SurfaceTypes

Surface types to be observed by the observer.

UpdateInterval

Gets or sets the frequency, in seconds, at which the spatial observer should update.

(Inherited from BaseSpatialObserver)
UpdateOnceInitialized

Whether the observer updates once after initialization (regardless whether AutoUpdate is true).

UsePersistentObjects

When enabled, the service will preserve previously observed surfaces when updating.

WorldMeshLevelOfDetail

Configures the density of the mesh retrieved from the service

Methods

CleanupObserver()

Ensures that the spatial observer has been stopped and destroyed.

(Inherited from BaseSpatialObserver)
ClearObservations()

Clears the observer's collection of observations.

(Inherited from BaseSpatialObserver)
CreateObserver()

Creates the spatial observer and handles the desired startup behavior.

(Inherited from BaseSpatialObserver)
Destroy()

Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.

(Inherited from BaseSpatialObserver)
Disable()

Optional Disable function to pause the service.

(Inherited from BaseSpatialObserver)
Dispose()

Cleanup resources used by this object.

(Inherited from BaseService)
Dispose(Boolean)

Cleanup resources used by the object

(Inherited from BaseSpatialObserver)
Enable()

Optional Enable function to enable / re-enable the service.

Equals(Object) (Inherited from BaseSpatialObserver)
GetHashCode() (Inherited from BaseSpatialObserver)
GetHashCode(Object) (Inherited from BaseSpatialObserver)
Initialize()

The initialize function is used to setup the service once created. This method is called once all services have been registered in the Mixed Reality Toolkit.

LateUpdate()

Optional LateUpdate function to that is called after Update has been called on all services.

(Inherited from BaseService)
Reset()

Suspends the observer, clears observations, cleans up the observer, then re-initializes.

(Inherited from BaseSpatialObserver)
Resume()

Start | resume the observer.

SaveScene(String)

Save a scene file to the device

Suspend()

Stop | pause the observer

TryFindCentermostPlacement(Int32, Vector2, Vector3)

Finds best placement position in local space to the quad

TryGetOcclusionMask(Int32, UInt16, UInt16, Byte[])

Gets the occlusion mask from a scene quad

Update()

Optional Update function to perform per-frame updates of the service.

(Inherited from BaseService)
UpdateOnDemand()

Tells the observer to update the observations.

Explicit Interface Implementations

IEqualityComparer.Equals(Object, Object) (Inherited from BaseSpatialObserver)

Applies to