Bewerken

Delen via


BaseSpatialMeshObserver Class

Definition

Class providing a base implementation of the IMixedRealitySpatialAwarenessMeshObserver interface.

public ref class BaseSpatialMeshObserver abstract : Microsoft::MixedReality::Toolkit::SpatialAwareness::BaseSpatialObserver, IDisposable, Microsoft::MixedReality::Toolkit::SpatialAwareness::IMixedRealitySpatialAwarenessMeshObserver, Microsoft::MixedReality::Toolkit::SpatialAwareness::ISpatialAwarenessPhysicsProperties, System::Collections::IEqualityComparer
public abstract class BaseSpatialMeshObserver : Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver, IDisposable, Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessMeshObserver, Microsoft.MixedReality.Toolkit.SpatialAwareness.ISpatialAwarenessPhysicsProperties, System.Collections.IEqualityComparer
type BaseSpatialMeshObserver = class
    inherit BaseSpatialObserver
    interface IMixedRealitySpatialAwarenessMeshObserver
    interface IMixedRealitySpatialAwarenessObserver
    interface IMixedRealityDataProvider
    interface IMixedRealityService
    interface IDisposable
    interface IMixedRealityEventSource
    interface IEqualityComparer
    interface ISpatialAwarenessPhysicsProperties
Public MustInherit Class BaseSpatialMeshObserver
Inherits BaseSpatialObserver
Implements IDisposable, IEqualityComparer, IMixedRealitySpatialAwarenessMeshObserver, ISpatialAwarenessPhysicsProperties
Inheritance
Derived
Implements

Constructors

BaseSpatialMeshObserver(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)
meshes

The backing field for Meshes, to allow the mesh observer implementation to track its meshes.

meshEventData
OnMeshAdded

Event sent whenever a mesh is added.

OnMeshRemoved

Event sent whenever a mesh is discarded.

OnMeshUpdated

Event sent whenever a mesh is updated.

Properties

ConfigurationProfile

The configuration profile for the service.

(Inherited from BaseService)
DefaultPhysicsLayer

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

(Inherited from BaseSpatialObserver)
DisplayOption

Gets or sets a value indicating how the mesh subsystem is to display surface meshes within the application.

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)
LevelOfDetail

Gets or sets the level of detail, as a MixedRealitySpatialAwarenessMeshLevelOfDetail value, for the returned spatial mesh. Setting this value to Custom, implies that the developer is specifying a custom value for MeshTrianglesPerCubicMeter.

Meshes

Gets the collection of SpatialAwarenessMeshObjects being managed by the observer.

MeshPhysicsLayer

Get or sets the desired Unity Physics Layer on which to set the spatial mesh.

MeshPhysicsLayerMask

Gets the bit mask that corresponds to the value specified in MeshPhysicsLayer.

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

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

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)
OcclusionMaterial

Gets or sets the Material to be used when spatial Meshes should occlude other objects.

PhysicsMaterial
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)
RecalculateNormals

Indicates whether or not mesh normals should be recalculated by the observer.

Registrar
Obsolete.

The service registrar instance that registered this service.

(Inherited from BaseDataProvider<T>)
RuntimeSpatialMeshPrefab System.Object.RuntimeSpatialMeshPrefab
Service

The service instance to which this provider is providing data.

(Inherited from BaseDataProvider<T>)
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)
TrianglesPerCubicMeter

Gets or sets the level of detail, in triangles per cubic meter, for the returned spatial mesh.

UpdateInterval

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

(Inherited from BaseSpatialObserver)
VisibleMaterial

Gets or sets the Material to be used when displaying Meshes.

Methods

AddRuntimeSpatialMeshPrefabToHierarchy()

Instantiates and appends a prefab to the Runtime (on device and not in editor) Spatial Awareness hierarchy.

The default structure of the Spatial Awareness System:

Spatial Awareness System Windows Mixed Reality Spatial Mesh Observer Spatial Mesh - ID Spatial Mesh - ID ...

If the Runtime Spatial Mesh Prefab field is not null, this method adds the prefab between the Spatial Awareness System and the Windows Mixed Reality Spatial Mesh Observer which results in this structure:

Spatial Awareness System Runtime Spatial Mesh Prefab Windows Mixed Reality Spatial Mesh Observer Spatial Mesh - ID Spatial Mesh - ID ...

ApplyUpdatedMeshDisplayOption(SpatialAwarenessMeshDisplayOptions)

Applies the mesh display option to existing meshes when modified at runtime.

ApplyUpdatedMeshPhysics()

Applies the physical material to existing meshes when modified at runtime.

ApplyUpdatedPhysicsLayer()

Updates the mesh physics layer for current mesh observations.

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.

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

Initializes event data and creates the observer.

LateUpdate()

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

(Inherited from BaseService)
LookupTriangleDensity(SpatialAwarenessMeshLevelOfDetail)

Maps SpatialAwarenessMeshLevelOfDetail to TrianglesPerCubicMeter.

ReadProfile()
Reset()

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

(Inherited from BaseSpatialObserver)
Resume()

Start | resume the observer.

(Inherited from BaseSpatialObserver)
Suspend()

Stop | pause the observer

(Inherited from BaseSpatialObserver)
Update()

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

(Inherited from BaseService)

Explicit Interface Implementations

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

Applies to