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

Commit

Permalink
Refactor of boundary system (#624)
Browse files Browse the repository at this point in the history
* initial refactor of boundary system

* sorted some properties

* updated examples checkout

* changed wmr checkout back to development

* updated examples

* fixed examples checkout

* test wmr build

* revert

* Added warning when geometry fails to be generated

* try setting the timeout to 2 hours

* updated wmr checkout with functional boundary data provider

* updated boundary tracked object logic

Added BoundsCache
updated Bounds Extension methods

* fix wait for log to be created

* updated examples checkout
  • Loading branch information
StephenHodgson authored Jun 12, 2020
1 parent c8e5e76 commit 632b84d
Show file tree
Hide file tree
Showing 22 changed files with 755 additions and 1,133 deletions.
2 changes: 1 addition & 1 deletion Submodules/WindowsMixedReality
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,46 @@
namespace XRTK.Editor.Profiles
{
[CustomEditor(typeof(MixedRealityBoundaryVisualizationProfile))]
public class MixedRealityBoundaryVisualizationProfileInspector : BaseMixedRealityProfileInspector
public class MixedRealityBoundaryVisualizationProfileInspector : MixedRealityServiceProfileInspector
{
private SerializedProperty showBoundary;
private SerializedProperty boundaryHeight;
private SerializedProperty physicsLayer;
private SerializedProperty boundaryMaterial;

private SerializedProperty showFloor;
private SerializedProperty floorMaterial;
private SerializedProperty floorScale;
private SerializedProperty floorPhysicsLayer;

private SerializedProperty showPlayArea;
private SerializedProperty playAreaMaterial;
private SerializedProperty playAreaPhysicsLayer;

private SerializedProperty showTrackedArea;
private SerializedProperty trackedAreaMaterial;
private SerializedProperty trackedAreaPhysicsLayer;
private SerializedProperty showWalls;
private SerializedProperty wallMaterial;

private SerializedProperty showBoundaryWalls;
private SerializedProperty boundaryWallMaterial;
private SerializedProperty boundaryWallsPhysicsLayer;
private SerializedProperty showCeiling;
private SerializedProperty ceilingMaterial;

private SerializedProperty showBoundaryCeiling;
private SerializedProperty boundaryCeilingMaterial;
private SerializedProperty ceilingPhysicsLayer;

private readonly GUIContent showContent = new GUIContent("Show");
private readonly GUIContent scaleContent = new GUIContent("Scale");
private readonly GUIContent materialContent = new GUIContent("Material");
private readonly GUIContent generalSettingsFoldoutHeader = new GUIContent("General Settings");
private readonly GUIContent floorSettingsFoldoutHeader = new GUIContent("Floor Settings");
private readonly GUIContent playAreaSettingsFoldoutHeader = new GUIContent("Play Area Settings");
private readonly GUIContent trackedAreaSettingsFoldoutHeader = new GUIContent("Tracked Area Settings");
private readonly GUIContent boundaryWallSettingsFoldoutHeader = new GUIContent("Boundary Wall Settings");
private readonly GUIContent boundaryCeilingSettingsFoldoutHeader = new GUIContent("Boundary Ceiling Settings");
private readonly GUIContent wallSettingsFoldoutHeader = new GUIContent("Wall Settings");
private readonly GUIContent ceilingSettingsFoldoutHeader = new GUIContent("Ceiling Settings");
private readonly GUIContent materialContent = new GUIContent("Material Override", "Use a different material than the global boundary material?");
private readonly GUIContent showContent = new GUIContent("Force Show", "Force the boundary component to be displayed.\n\nNote: This can be toggled on/off at runtime.");

protected override void OnEnable()
{
base.OnEnable();

showBoundary = serializedObject.FindProperty(nameof(showBoundary));
boundaryHeight = serializedObject.FindProperty(nameof(boundaryHeight));
boundaryMaterial = serializedObject.FindProperty(nameof(boundaryMaterial));
physicsLayer = serializedObject.FindProperty(nameof(physicsLayer));

showFloor = serializedObject.FindProperty(nameof(showFloor));
floorMaterial = serializedObject.FindProperty(nameof(floorMaterial));
floorScale = serializedObject.FindProperty(nameof(floorScale));
floorPhysicsLayer = serializedObject.FindProperty(nameof(floorPhysicsLayer));

showPlayArea = serializedObject.FindProperty(nameof(showPlayArea));
playAreaMaterial = serializedObject.FindProperty(nameof(playAreaMaterial));
playAreaPhysicsLayer = serializedObject.FindProperty(nameof(playAreaPhysicsLayer));

showTrackedArea = serializedObject.FindProperty(nameof(showTrackedArea));
trackedAreaMaterial = serializedObject.FindProperty(nameof(trackedAreaMaterial));
trackedAreaPhysicsLayer = serializedObject.FindProperty(nameof(trackedAreaPhysicsLayer));
showWalls = serializedObject.FindProperty(nameof(showWalls));
wallMaterial = serializedObject.FindProperty(nameof(wallMaterial));

showBoundaryWalls = serializedObject.FindProperty(nameof(showBoundaryWalls));
boundaryWallMaterial = serializedObject.FindProperty(nameof(boundaryWallMaterial));
boundaryWallsPhysicsLayer = serializedObject.FindProperty(nameof(boundaryWallsPhysicsLayer));

showBoundaryCeiling = serializedObject.FindProperty(nameof(showBoundaryCeiling));
boundaryCeilingMaterial = serializedObject.FindProperty(nameof(boundaryCeilingMaterial));
ceilingPhysicsLayer = serializedObject.FindProperty(nameof(ceilingPhysicsLayer));
showCeiling = serializedObject.FindProperty(nameof(showCeiling));
ceilingMaterial = serializedObject.FindProperty(nameof(ceilingMaterial));
}

public override void OnInspectorGUI()
Expand All @@ -77,65 +57,50 @@ public override void OnInspectorGUI()

serializedObject.Update();

boundaryHeight.FoldoutWithBoldLabelPropertyField(generalSettingsFoldoutHeader);

EditorGUILayout.Space();

if (showFloor.FoldoutWithBoldLabelPropertyField(floorSettingsFoldoutHeader, showContent))
if (showBoundary.FoldoutWithBoldLabelPropertyField(generalSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(floorMaterial, materialContent);
var prevWideMode = EditorGUIUtility.wideMode;
EditorGUIUtility.wideMode = true;
EditorGUILayout.PropertyField(floorScale, scaleContent, GUILayout.ExpandWidth(true));
EditorGUIUtility.wideMode = prevWideMode;
EditorGUILayout.PropertyField(floorPhysicsLayer);
EditorGUI.indentLevel--;
}
EditorGUILayout.PropertyField(boundaryHeight);
EditorGUILayout.PropertyField(boundaryMaterial, materialContent);
EditorGUILayout.PropertyField(physicsLayer);

EditorGUILayout.Space();
EditorGUILayout.Space();

if (showPlayArea.FoldoutWithBoldLabelPropertyField(playAreaSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(playAreaMaterial, materialContent);
EditorGUILayout.PropertyField(playAreaPhysicsLayer);
EditorGUI.indentLevel--;
}
if (showFloor.FoldoutWithBoldLabelPropertyField(floorSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(floorMaterial, materialContent);
EditorGUI.indentLevel--;
}

EditorGUILayout.Space();
EditorGUILayout.Space();

if (showTrackedArea.FoldoutWithBoldLabelPropertyField(trackedAreaSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(trackedAreaMaterial, materialContent);
EditorGUILayout.PropertyField(trackedAreaPhysicsLayer);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();

EditorGUILayout.Space();
if (showWalls.FoldoutWithBoldLabelPropertyField(wallSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(wallMaterial, materialContent);
EditorGUI.indentLevel--;
}

if (showBoundaryWalls.FoldoutWithBoldLabelPropertyField(boundaryWallSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(boundaryWallMaterial, materialContent);
EditorGUILayout.PropertyField(boundaryWallsPhysicsLayer);
EditorGUI.indentLevel--;
}
EditorGUILayout.Space();

EditorGUILayout.Space();
if (showCeiling.FoldoutWithBoldLabelPropertyField(ceilingSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(ceilingMaterial, materialContent);
EditorGUI.indentLevel--;
}

if (showBoundaryCeiling.FoldoutWithBoldLabelPropertyField(boundaryCeilingSettingsFoldoutHeader, showContent))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(boundaryCeilingMaterial, materialContent);
EditorGUILayout.PropertyField(ceilingPhysicsLayer);
EditorGUI.indentLevel--;
}

EditorGUILayout.Space();

serializedObject.ApplyModifiedProperties();

base.OnInspectorGUI();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public Edge(Vector2 pointA, Vector2 pointB)
public Edge(Vector3 pointA, Vector3 pointB) :
// Use the X and Z parameters as our edges are height agnostic.
this(new Vector2(pointA.x, pointA.z), new Vector2(pointB.x, pointB.z))
{ }
{
}
}
}
Loading

0 comments on commit 632b84d

Please sign in to comment.