Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Implement BoundaryVisibility (#822)
Browse files Browse the repository at this point in the history
* Implement BoundaryVisibility

* updated submodules

updated packages

Co-authored-by: Stephen Hodgson <hodgson.designs@gmail.com>
  • Loading branch information
FejZa and StephenHodgson authored Apr 30, 2021
1 parent 68fb935 commit b875074
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 8 deletions.
27 changes: 27 additions & 0 deletions Runtime/Definitions/BoundarySystem/BoundaryVisibility.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace XRTK.Definitions.BoundarySystem
{
/// <summary>
/// Defines available visibility state for platform boundaries used by the
/// <see cref="Interfaces.BoundarySystem.IMixedRealityBoundarySystem"/>.
/// </summary>
public enum BoundaryVisibility
{
/// <summary>
/// The boundaries visibility status is unknown. Platform boundaries visibility
/// may be unknown e.g. when the platform does not provide an API for XRTK to query
/// boundary visibility state.
/// </summary>
Unknown = 0,
/// <summary>
/// The boundaries are hidden.
/// </summary>
Hidden,
/// <summary>
/// The boundaries are visible.
/// </summary>
Visible
}
}
11 changes: 11 additions & 0 deletions Runtime/Definitions/BoundarySystem/BoundaryVisibility.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Collections.Generic;
using UnityEngine;
using System.Collections.Generic;
using XRTK.Definitions.BoundarySystem;

namespace XRTK.Interfaces.BoundarySystem
{
/// <summary>
/// Mixed Reality Toolkit boundary data provider definition, used to instantiate and manage low level api access specific devices, SDKs, and libraries.
/// Boundary data providers provide low level data access for the <see cref="IMixedRealityBoundarySystem"/> to query
/// platform boundary state.
/// </summary>
public interface IMixedRealityBoundaryDataProvider : IMixedRealityDataProvider
{
/// <summary>
/// Is the platform's boundary visible?
/// Gets the current boundary visibility.
/// </summary>
bool IsPlatformBoundaryVisible { get; set; }
BoundaryVisibility Visibility { get; }

/// <summary>
/// The the platform's boundary configured?
/// Gets whether boundaries have been configured and are active.
/// </summary>
bool IsPlatformConfigured { get; }

/// <summary>
/// Try to get the boundary geometry from the library api.
/// Tries to retrieve up to date boundary points in world space.
/// </summary>
/// <param name="geometry">The list of points associated with the boundary geometry.</param>
/// <returns>True, if valid geometry was successfully returned, otherwise false.</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public IMixedRealityBoundaryDataProvider BoundaryDataProvider
/// <inheritdoc />
public bool IsVisible
{
get => (BoundaryDataProvider != null && BoundaryDataProvider.IsPlatformBoundaryVisible) ||
get => (BoundaryDataProvider != null && BoundaryDataProvider.Visibility == BoundaryVisibility.Visible) ||
!BoundarySystemVisualizationRoot.IsNull() && BoundarySystemVisualizationRoot.activeInHierarchy &&
(ShowBoundary ||
ShowFloor ||
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Mixed Reality",
"DI"
],
"version": "0.2.11",
"version": "0.2.12",
"unity": "2019.4",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit b875074

Please sign in to comment.