Skip to content

Commit 405b271

Browse files
author
David Kline (ANALOG)
committed
move experience scale setting out of boundary settings
1 parent 803931e commit 405b271

File tree

6 files changed

+77
-31
lines changed

6 files changed

+77
-31
lines changed

Assets/MixedRealityToolkit-SDK/Profiles/DefaultMixedRealityConfigurationProfile.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ MonoBehaviour:
1111
m_Script: {fileID: 11500000, guid: 41718b8e5d86c37409b7ce6847fa00a3, type: 3}
1212
m_Name: DefaultMixedRealityConfigurationProfile
1313
m_EditorClassIdentifier:
14+
targetExperienceScale: 3
1415
enableCameraProfile: 1
1516
cameraProfile: {fileID: 11400000, guid: b9a895b32a50a7f45b1e4da728d50741, type: 2}
1617
enableInputSystem: 1
@@ -28,6 +29,5 @@ MonoBehaviour:
2829
boundarySystemType:
2930
reference: Microsoft.MixedReality.Toolkit.Internal.Managers.MixedRealityBoundaryManager,
3031
Microsoft.MixedReality.Toolkit
31-
boundaryExperienceScale: 3
3232
boundaryHeight: 3
3333
enablePlatformBoundaryRendering: 1

Assets/MixedRealityToolkit/_Core/Boundary/MixedRealityBoundarySystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class MixedRealityBoundaryManager : BaseManager, IMixedRealityBoundarySys
3737
/// </summary>
3838
public MixedRealityBoundaryManager()
3939
{
40-
Scale = MixedRealityManager.Instance.ActiveProfile.BoundaryExperienceScale;
40+
Scale = MixedRealityManager.Instance.ActiveProfile.TargetExperienceScale;
4141
BoundaryHeight = MixedRealityManager.Instance.ActiveProfile.BoundaryHeight;
4242
EnablePlatformBoundaryRendering = MixedRealityManager.Instance.ActiveProfile.EnablePlatformBoundaryRendering;
4343
}

Assets/MixedRealityToolkit/_Core/Definitions/MixedRealityConfigurationProfile.cs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ public class MixedRealityConfigurationProfile : ScriptableObject, ISerialization
4343

4444
#region Mixed Reality Manager configurable properties
4545

46+
[SerializeField]
47+
[Tooltip("The scale of the Mixed Reality experience.")]
48+
private ExperienceScale targetExperienceScale = ExperienceScale.Room;
49+
50+
/// <summary>
51+
/// The desired the scale of the experience.
52+
/// </summary>
53+
public ExperienceScale TargetExperienceScale
54+
{
55+
get { return targetExperienceScale; }
56+
set { targetExperienceScale = value; }
57+
}
58+
4659
[SerializeField]
4760
[Tooltip("Enable the Camera Profile on Startup")]
4861
private bool enableCameraProfile = false;
@@ -84,8 +97,7 @@ public bool EnableInputSystem
8497
{
8598
get
8699
{
87-
return inputSystemType?.Type != null &&
88-
inputActionsProfile != null &&
100+
return inputActionsProfile != null &&
89101
enableInputSystem;
90102
}
91103
private set { enableInputSystem = value; }
@@ -201,19 +213,6 @@ public SystemType BoundarySystemSystemType
201213
private set { boundarySystemType = value; }
202214
}
203215

204-
[SerializeField]
205-
[Tooltip("The scale of the Mixed Reality experience.")]
206-
private ExperienceScale boundaryExperienceScale = ExperienceScale.Room;
207-
208-
/// <summary>
209-
/// Configure the scale of the experience.
210-
/// </summary>
211-
public ExperienceScale BoundaryExperienceScale
212-
{
213-
get { return boundaryExperienceScale; }
214-
set { boundaryExperienceScale = value; }
215-
}
216-
217216
[SerializeField]
218217
[Tooltip("The approximate height of the playspace, in meters.")]
219218
private float boundaryHeight = 3.0f;

Assets/MixedRealityToolkit/_Core/Definitions/Utilities/ExperienceScale.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ namespace Microsoft.MixedReality.Toolkit.Internal.Definitions.Utilities
1010
public enum ExperienceScale
1111
{
1212
/// <summary>
13-
/// An experience which utilizes only the headset orientantion and is gravity aligned.
13+
/// An experience which utilizes only the headset orientantion and is gravity aligned. The coordinate system origin is at head level.
1414
/// </summary>
1515
OrientationOnly = 0,
1616
/// <summary>
17-
/// An experience designed for seated use.
17+
/// An experience designed for seated use. The coordinate system origin is at head level.
1818
/// </summary>
1919
Seated,
2020
/// <summary>
21-
/// An experience designed for stationary standing use.
21+
/// An experience designed for stationary standing use. The coordinate system origin is at floor level.
2222
/// </summary>
2323
Standing,
2424
/// <summary>
25-
/// An experience designed to support movement thoughtout a room.
25+
/// An experience designed to support movement thoughtout a room. The coordinate system origin is at floor level.
2626
/// </summary>
2727
Room,
2828
/// <summary>
29-
/// An experience designed to utilize and move through the physical world.
29+
/// An experience designed to utilize and move through the physical world. The coordinate system origin is at head level.
3030
/// </summary>
3131
World
3232
}

Assets/MixedRealityToolkit/_Core/Inspectors/MixedRealityConfigurationProfileInspector.cs

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public class MixedRealityConfigurationProfileInspector : MixedRealityBaseConfigu
1515
{
1616
private static readonly GUIContent NewProfileContent = new GUIContent("+", "Create New Profile");
1717

18+
// Experience properties
19+
private SerializedProperty targetExperienceScale;
1820
// Camera properties
1921
private SerializedProperty enableCameraProfile;
2022
private SerializedProperty cameraProfile;
@@ -29,7 +31,6 @@ public class MixedRealityConfigurationProfileInspector : MixedRealityBaseConfigu
2931
// Boundary system properties
3032
private SerializedProperty enableBoundarySystem;
3133
private SerializedProperty boundarySystemType;
32-
private SerializedProperty boundaryExperienceScale;
3334
private SerializedProperty boundaryHeight;
3435
private SerializedProperty enablePlatformBoundaryRendering;
3536

@@ -68,18 +69,22 @@ private void OnEnable()
6869
}
6970

7071
configurationProfile = target as MixedRealityConfigurationProfile;
72+
// Experience configuration
73+
targetExperienceScale = serializedObject.FindProperty("targetExperienceScale");
74+
// Camera configuration
7175
enableCameraProfile = serializedObject.FindProperty("enableCameraProfile");
7276
cameraProfile = serializedObject.FindProperty("cameraProfile");
77+
// Input system configuration
7378
enableInputSystem = serializedObject.FindProperty("enableInputSystem");
7479
inputSystemType = serializedObject.FindProperty("inputSystemType");
7580
inputActionsProfile = serializedObject.FindProperty("inputActionsProfile");
7681
enableSpeechCommands = serializedObject.FindProperty("enableSpeechCommands");
7782
speechCommandsProfile = serializedObject.FindProperty("speechCommandsProfile");
7883
enableControllerProfiles = serializedObject.FindProperty("enableControllerProfiles");
7984
controllersProfile = serializedObject.FindProperty("controllersProfile");
85+
// Boundary system configuration
8086
enableBoundarySystem = serializedObject.FindProperty("enableBoundarySystem");
8187
boundarySystemType = serializedObject.FindProperty("boundarySystemType");
82-
boundaryExperienceScale = serializedObject.FindProperty("boundaryExperienceScale");
8388
boundaryHeight = serializedObject.FindProperty("boundaryHeight");
8489
enablePlatformBoundaryRendering = serializedObject.FindProperty("enablePlatformBoundaryRendering");
8590
}
@@ -93,7 +98,42 @@ public override void OnInspectorGUI()
9398
EditorGUIUtility.labelWidth = 160f;
9499
EditorGUI.BeginChangeCheck();
95100

96-
// Camera Profile Configuration
101+
// Experience configuration
102+
EditorGUILayout.LabelField("Experience Settings", EditorStyles.boldLabel);
103+
EditorGUILayout.PropertyField(targetExperienceScale, new GUIContent("Target Scale:"));
104+
ExperienceScale scale = (ExperienceScale)targetExperienceScale.intValue;
105+
string scaleDesciription = string.Empty;
106+
switch (scale)
107+
{
108+
case ExperienceScale.OrientationOnly:
109+
scaleDesciription = "The user is stationary. Position data does not change.";
110+
break;
111+
112+
case ExperienceScale.Seated:
113+
scaleDesciription = "The user is stationary and seated. The origin of the world is at a neutral head-level position.";
114+
break;
115+
116+
case ExperienceScale.Standing:
117+
scaleDesciription = "The user is stationary and standing. The origin of the world is on the floor, facing forward.";
118+
break;
119+
120+
case ExperienceScale.Room:
121+
scaleDesciription = "The user is free to move about the room. The origin of the world is on the floor, facing forward. Boundaries are available.";
122+
break;
123+
124+
case ExperienceScale.World:
125+
scaleDesciription = "The user is free to move about the world. Relies upon knowledge of the environment (Spatial Anchors and Spatial Mapping).";
126+
break;
127+
}
128+
if (scaleDesciription != string.Empty)
129+
{
130+
GUILayout.Space(6f);
131+
EditorGUILayout.LabelField("Description:", EditorStyles.label);
132+
EditorGUILayout.LabelField(scaleDesciription, EditorStyles.wordWrappedLabel);
133+
}
134+
135+
// Camera Profile configuration
136+
GUILayout.Space(12f);
97137
EditorGUILayout.LabelField("Camera Settings", EditorStyles.boldLabel);
98138
EditorGUILayout.PropertyField(enableCameraProfile);
99139

@@ -102,7 +142,8 @@ public override void OnInspectorGUI()
102142
RenderProfile(cameraProfile);
103143
}
104144

105-
//Input System configuration
145+
// Input System configuration
146+
GUILayout.Space(12f);
106147
EditorGUILayout.LabelField("Input Settings", EditorStyles.boldLabel);
107148
EditorGUILayout.PropertyField(enableInputSystem);
108149

@@ -118,7 +159,7 @@ public override void OnInspectorGUI()
118159
}
119160
}
120161

121-
//Controller mapping configuration
162+
// Controller mapping configuration
122163
GUILayout.Space(12f);
123164
EditorGUILayout.LabelField("Controller Mapping Settings", EditorStyles.boldLabel);
124165
EditorGUILayout.PropertyField(enableControllerProfiles);
@@ -128,20 +169,26 @@ public override void OnInspectorGUI()
128169
RenderProfile(controllersProfile);
129170
}
130171

131-
//Boundary System configuration
172+
// Boundary System configuration
132173
GUILayout.Space(12f);
133174
EditorGUILayout.LabelField("Boundary Settings", EditorStyles.boldLabel);
134175
EditorGUILayout.PropertyField(enableBoundarySystem);
135176

136177
if (enableBoundarySystem.boolValue)
137178
{
138179
EditorGUILayout.PropertyField(boundarySystemType);
139-
EditorGUILayout.PropertyField(boundaryExperienceScale, new GUIContent("Experience Scale:"));
140-
if ((ExperienceScale)boundaryExperienceScale.intValue == ExperienceScale.Room)
180+
// Boundary settings depend on the experience scale
181+
182+
if (scale == ExperienceScale.Room)
141183
{
142184
EditorGUILayout.PropertyField(boundaryHeight, new GUIContent("Boundary Height (in m):"));
143185
EditorGUILayout.PropertyField(enablePlatformBoundaryRendering, new GUIContent("Platform Rendering:"));
144186
}
187+
else
188+
{
189+
GUILayout.Space(6f);
190+
EditorGUILayout.LabelField("Boundaries are only supported in Room scale experiences.", EditorStyles.label);
191+
}
145192
}
146193

147194
EditorGUIUtility.labelWidth = previousLabelWidth;

Assets/MixedRealityToolkit/_Core/Interfaces/IMixedRealityBoundarySystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.MixedReality.Toolkit.Internal.Interfaces
1313
public interface IMixedRealityBoundarySystem : IMixedRealityManager
1414
{
1515
/// <summary>
16-
/// The scale (ex: World Scale) for which the experience was designed.
16+
/// The scale (ex: World Scale) of the experience.
1717
/// </summary>
1818
ExperienceScale Scale { get; set; }
1919

0 commit comments

Comments
 (0)