Class MixedRealitySpatialAwarenessSystem
Class providing the default implementation of the IMixedRealitySpatialAwarenessSystem interface.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.SpatialAwareness
Assembly: cs.temp.dll.dll
Syntax
public class MixedRealitySpatialAwarenessSystem : BaseDataProviderAccessCoreSystem, IMixedRealityDataProviderAccess, IMixedRealitySpatialAwarenessSystem, IMixedRealityEventSystem, IMixedRealityService, IDisposable, IMixedRealityCapabilityCheck
Constructors
MixedRealitySpatialAwarenessSystem(IMixedRealityServiceRegistrar, MixedRealitySpatialAwarenessSystemProfile)
Declaration
public MixedRealitySpatialAwarenessSystem(IMixedRealityServiceRegistrar registrar, MixedRealitySpatialAwarenessSystemProfile profile)
Parameters
Type | Name | Description |
---|---|---|
IMixedRealityServiceRegistrar | registrar | |
MixedRealitySpatialAwarenessSystemProfile | profile |
Properties
Name
Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action.
Declaration
public override string Name { get; protected set; }
Property Value
Type | Description |
---|---|
String |
Overrides
SpatialAwarenessObjectParent
Gets the parent object to which all spatial awareness GameObjects are to be parented.
Declaration
public GameObject SpatialAwarenessObjectParent { get; }
Property Value
Type | Description |
---|---|
GameObject |
SpatialAwarenessSystemProfile
Typed representation of the ConfigurationProfile property.
Declaration
public MixedRealitySpatialAwarenessSystemProfile SpatialAwarenessSystemProfile { get; }
Property Value
Type | Description |
---|---|
MixedRealitySpatialAwarenessSystemProfile |
Methods
CheckCapability(MixedRealityCapability)
Checks to see if one or more registered data providers supports the requested capability on the current platform.
Declaration
public bool CheckCapability(MixedRealityCapability capability)
Parameters
Type | Name | Description |
---|---|---|
MixedRealityCapability | capability | The capability to check. |
Returns
Type | Description |
---|---|
Boolean | True if the capability is supported, false otherwise. |
ClearObservations()
Clears all registered observers' observations.
Declaration
public void ClearObservations()
ClearObservations<T>(String)
Clears the observations of the specified observer.
Declaration
public void ClearObservations<T>(string name)
where T : IMixedRealitySpatialAwarenessObserver
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the observer. |
Type Parameters
Name | Description |
---|---|
T | The observer type. |
CreateSpatialAwarenessObservationParent(String)
Creates the a parent, that is a child of the Spatial Awareness System parent so that the scene hierarchy does not get overly cluttered.
Declaration
public GameObject CreateSpatialAwarenessObservationParent(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name |
Returns
Type | Description |
---|---|
GameObject | The GameObject to which spatial awareness objects will be parented. |
Remarks
This method is to be called by implementations of the IMixedRealitySpatialAwarenessObserver interface, not by application code. It is used to enable observations to be grouped by observer.
Destroy()
Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.
Declaration
public override void Destroy()
Overrides
Disable()
Optional Disable function to pause the service.
Declaration
public override void Disable()
Overrides
Enable()
Optional Enable function to enable / re-enable the service.
Declaration
public override void Enable()
Overrides
GenerateNewSourceId()
Generates a new source identifier for an IMixedRealitySpatialAwarenessObserver implementation.
Declaration
public uint GenerateNewSourceId()
Returns
Type | Description |
---|---|
UInt32 | The source identifier to be used by the IMixedRealitySpatialAwarenessObserver implementation. |
Remarks
This method is to be called by implementations of the IMixedRealitySpatialAwarenessObserver interface, not by application code.
GetDataProvider<T>(String)
Get the data provider that is registered under the specified name (optional) and matching the specified type.
Declaration
public override T GetDataProvider<T>(string name = null)
where T : IMixedRealityDataProvider
Parameters
Type | Name | Description |
---|---|---|
String | name | The friendly name of the data provider. |
Returns
Type | Description |
---|---|
T | The requested data provider, or null if one cannot be found. |
Type Parameters
Name | Description |
---|---|
T | The desired data provider type. |
Overrides
Remarks
If more than one data provider is registered under the specified name, the first will be returned.
GetDataProviders<T>()
Get the collection of registered observers of the specified type.
Declaration
public override IReadOnlyList<T> GetDataProviders<T>()
where T : IMixedRealityDataProvider
Returns
Type | Description |
---|---|
IReadOnlyList<T> | Read-only copy of the list of registered data providers that implement the specified type. |
Type Parameters
Name | Description |
---|---|
T | The desired data provider type |
Overrides
GetObserver(String)
Get the IMixedRealitySpatialAwarenessObserver that is registered under the specified name.
Declaration
public IMixedRealitySpatialAwarenessObserver GetObserver(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The friendly name of the observer. |
Returns
Type | Description |
---|---|
IMixedRealitySpatialAwarenessObserver | The requested observer, or null if one cannot be found. |
Remarks
If more than one observer is registered under the specified name, the first will be returned.
GetObserver<T>(String)
Get the observer that is registered under the specified name matching the specified type.
Declaration
public T GetObserver<T>(string name = null)
where T : IMixedRealitySpatialAwarenessObserver
Parameters
Type | Name | Description |
---|---|---|
String | name | The friendly name of the observer. |
Returns
Type | Description |
---|---|
T | The requested observer, or null if one cannot be found. |
Type Parameters
Name | Description |
---|---|
T | The desired spatial awareness observer type (ex: IMixedRealitySpatialAwarenessMeshObserver) |
Remarks
If more than one observer is registered under the specified name, the first will be returned.
GetObservers()
Gets the collection of registered IMixedRealitySpatialAwarenessObserver data providers.
Declaration
public IReadOnlyList<IMixedRealitySpatialAwarenessObserver> GetObservers()
Returns
Type | Description |
---|---|
IReadOnlyList<IMixedRealitySpatialAwarenessObserver> | Read only copy of the list of registered observers. |
GetObservers<T>()
Get the collection of registered observers of the specified type.
Declaration
public IReadOnlyList<T> GetObservers<T>()
where T : IMixedRealitySpatialAwarenessObserver
Returns
Type | Description |
---|---|
IReadOnlyList<T> | Readonly copy of the list of registered observers that implement the specified type. |
Type Parameters
Name | Description |
---|---|
T | The desired spatial awareness observer type (ex: IMixedRealitySpatialAwarenessMeshObserver) |
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.
Declaration
public override void Initialize()
Overrides
Reset()
Optional Reset function to perform that will Reset the service, for example, whenever there is a profile change.
Declaration
public override void Reset()
Overrides
ResumeObserver<T>(String)
Starts / restarts the spatial observer registered under the specified name matching the specified type.
Declaration
public void ResumeObserver<T>(string name)
where T : IMixedRealitySpatialAwarenessObserver
Parameters
Type | Name | Description |
---|---|---|
String | name | The friendly name of the observer. |
Type Parameters
Name | Description |
---|---|
T | The desired spatial awareness observer type (ex: IMixedRealitySpatialAwarenessMeshObserver) |
ResumeObservers()
Starts / restarts all spatial observers of the specified type.
Declaration
public void ResumeObservers()
ResumeObservers<T>()
Starts / restarts all spatial observers of the specified type.
Declaration
public void ResumeObservers<T>()
where T : IMixedRealitySpatialAwarenessObserver
Type Parameters
Name | Description |
---|---|
T | The desired spatial awareness observer type (ex: IMixedRealitySpatialAwarenessMeshObserver) |
SuspendObserver<T>(String)
Stops / pauses the spatial observer registered under the specified name matching the specified type.
Declaration
public void SuspendObserver<T>(string name)
where T : IMixedRealitySpatialAwarenessObserver
Parameters
Type | Name | Description |
---|---|---|
String | name | The friendly name of the observer. |
Type Parameters
Name | Description |
---|---|
T | The desired spatial awareness observer type (ex: IMixedRealitySpatialAwarenessMeshObserver) |
SuspendObservers()
Stops / pauses all spatial observers.
Declaration
public void SuspendObservers()
SuspendObservers<T>()
Stops / pauses all spatial observers of the specified type.
Declaration
public void SuspendObservers<T>()
where T : IMixedRealitySpatialAwarenessObserver
Type Parameters
Name | Description |
---|---|
T |