Class MixedRealityBoundarySystem
The Boundary system controls the presentation and display of the users boundary in a scene.
Implements
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Boundary
Assembly: cs.temp.dll.dll
Syntax
public class MixedRealityBoundarySystem : BaseCoreSystem, IMixedRealityBoundarySystem, IMixedRealityEventSystem, IMixedRealityService, IDisposable, IMixedRealityEventSource, IEqualityComparer
Constructors
MixedRealityBoundarySystem(IMixedRealityServiceRegistrar, MixedRealityBoundaryVisualizationProfile, ExperienceScale)
Declaration
public MixedRealityBoundarySystem(IMixedRealityServiceRegistrar registrar, MixedRealityBoundaryVisualizationProfile profile, ExperienceScale scale)
Parameters
Type | Name | Description |
---|---|---|
IMixedRealityServiceRegistrar | registrar | |
MixedRealityBoundaryVisualizationProfile | profile | |
ExperienceScale | scale |
Properties
BoundaryHeight
The height of the play space, in meters.
Declaration
public float BoundaryHeight { get; set; }
Property Value
Type | Description |
---|---|
Single |
Remarks
This is used to create a three dimensional boundary volume.
BoundaryVisualizationProfile
Typed representation of the ConfigurationProfile property.
Declaration
public MixedRealityBoundaryVisualizationProfile BoundaryVisualizationProfile { get; }
Property Value
Type | Description |
---|---|
MixedRealityBoundaryVisualizationProfile |
BoundaryWallsPhysicsLayer
The physics layer that the generated boundary walls are assigned to.
Declaration
public int BoundaryWallsPhysicsLayer { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Bounds
Two dimensional representation of the geometry of the boundary, as provided by the platform.
Declaration
public Edge[] Bounds { get; }
Property Value
Type | Description |
---|---|
Edge[] |
Remarks
BoundaryGeometry should be treated as the outline of the player's space, placed on the floor.
CeilingPhysicsLayer
The physics layer that the generated boundary ceiling is assigned to.
Declaration
public int CeilingPhysicsLayer { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
FloorHeight
Indicates the height of the floor, in relation to the coordinate system origin.
Declaration
public float? FloorHeight { get; }
Property Value
Type | Description |
---|---|
Nullable<Single> |
Remarks
If a floor has been located, FloorHeight.HasValue will be true, otherwise it will be false.
FloorPhysicsLayer
The physics layer that the generated floor is assigned to.
Declaration
public int FloorPhysicsLayer { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
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
PlayAreaPhysicsLayer
The physics layer that the generated play area is assigned to.
Declaration
public int PlayAreaPhysicsLayer { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Scale
The scale (ex: World Scale) of the experience.
Declaration
public ExperienceScale Scale { get; set; }
Property Value
Type | Description |
---|---|
ExperienceScale |
ShowBoundaryCeiling
Enable / disable ceiling rendering.
Declaration
public bool ShowBoundaryCeiling { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
The ceiling is defined as a GameObject positioned BoundaryHeight above the floor.
ShowBoundaryWalls
Enable / disable boundary wall rendering.
Declaration
public bool ShowBoundaryWalls { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ShowFloor
Enable / disable floor rendering.
Declaration
public bool ShowFloor { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ShowPlayArea
Enable / disable play area rendering.
Declaration
public bool ShowPlayArea { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ShowTrackedArea
Enable / disable tracked area rendering.
Declaration
public bool ShowTrackedArea { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
SourceId
The Unique Source Id of this Event Source.
Declaration
public uint SourceId { get; }
Property Value
Type | Description |
---|---|
UInt32 |
SourceName
The Name of this Event Source.
Declaration
public string SourceName { get; }
Property Value
Type | Description |
---|---|
String |
TrackedAreaPhysicsLayer
The physics layer that the generated tracked area is assigned to.
Declaration
public int TrackedAreaPhysicsLayer { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Contains(Vector3, UnityBoundary.Type)
Determines if a location is within the specified area of the boundary space.
Declaration
public bool Contains(Vector3 location, UnityBoundary.Type boundaryType = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | location | The location to be checked. |
UnityBoundary.Type | boundaryType | The type of boundary space being checked. |
Returns
Type | Description |
---|---|
Boolean | True if the location is within the specified area of the boundary space. |
Remarks
Use: Boundary.Type.PlayArea for the inscribed volume Boundary.Type.TrackedArea for the area defined by the boundary edges.
Destroy()
Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.
Declaration
public override void Destroy()
Overrides
GetBoundaryCeilingVisualization()
Gets the GameObject that represents the upper surface of the user's boundary.
Declaration
public GameObject GetBoundaryCeilingVisualization()
Returns
Type | Description |
---|---|
GameObject | The boundary ceiling visualization object or null if one does not exist. |
GetBoundaryWallVisualization()
Gets the GameObject that represents the user's boundary walls.
Declaration
public GameObject GetBoundaryWallVisualization()
Returns
Type | Description |
---|---|
GameObject | The boundary wall visualization object or null if one does not exist. |
GetFloorVisualization()
Gets the GameObject that represents the user's floor.
Declaration
public GameObject GetFloorVisualization()
Returns
Type | Description |
---|---|
GameObject | The floor visualization object or null if one does not exist. |
GetHashCode(Object)
Declaration
public int GetHashCode(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Int32 |
GetPlayAreaVisualization()
Gets the GameObject that represents the user's play area.
Declaration
public GameObject GetPlayAreaVisualization()
Returns
Type | Description |
---|---|
GameObject | The play area visualization object or null if one does not exist. |
GetTrackedAreaVisualization()
Gets the GameObject that represents the user's tracked area.
Declaration
public GameObject GetTrackedAreaVisualization()
Returns
Type | Description |
---|---|
GameObject | The tracked area visualization object or null if one does not exist. |
HandleEvent<T>(BaseEventData, ExecuteEvents.EventFunction<T>)
Declaration
public override void HandleEvent<T>(BaseEventData eventData, ExecuteEvents.EventFunction<T> eventHandler)
where T : IEventSystemHandler
Parameters
Type | Name | Description |
---|---|---|
BaseEventData | eventData | |
ExecuteEvents.EventFunction<T> | eventHandler |
Type Parameters
Name | Description |
---|---|
T |
Overrides
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
Register(GameObject)
Registers the GameObject to listen for boundary events.
Declaration
public override void Register(GameObject listener)
Parameters
Type | Name | Description |
---|---|---|
GameObject | listener |
Overrides
TryGetRectangularBoundsParams(out Vector2, out Single, out Single, out Single)
Returns the description of the inscribed rectangular bounds.
Declaration
public bool TryGetRectangularBoundsParams(out Vector2 center, out float angle, out float width, out float height)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | center | The center of the rectangle. |
Single | angle | The orientation of the rectangle. |
Single | width | The width of the rectangle. |
Single | height | The height of the rectangle. |
Returns
Type | Description |
---|---|
Boolean | True if an inscribed rectangle was found in the boundary geometry, false otherwise. |
Unregister(GameObject)
UnRegisters the GameObject to listen for boundary events. ///
Declaration
public override void Unregister(GameObject listener)
Parameters
Type | Name | Description |
---|---|---|
GameObject | listener |