Skip to content

Commit

Permalink
Add CameraSettingsManager to the MRTK XR Rig (#11684)
Browse files Browse the repository at this point in the history
* Add the 'Unknown' display type and default to 'Unknown' when there is no running XRDisplaySubsystem running.  Add CameraSettingsManager to the MRTK XR Rig prefab

* Change 'Unknown' display type value to be 0
  • Loading branch information
shaynie authored Jul 6, 2023
1 parent 59657db commit bda1893
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
8 changes: 0 additions & 8 deletions UnityProjects/MRTKDevTemplate/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,6 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.mono-cecil": {
"version": "1.10.1",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 1,
Expand All @@ -289,7 +282,6 @@
"dependencies": {},
"url": "https://packages.unity.com"
},

"com.unity.subsystemregistration": {
"version": "1.1.0",
"depth": 1,
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.mrtk.core/Camera/CameraSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private DisplayType GetDisplayType()
{
using (GetDisplayTypePerfMarker.Auto())
{
if (XRSubsystemHelpers.DisplaySubsystem == null) { return DisplayType.Transparent; }
if (XRSubsystemHelpers.DisplaySubsystem == null) { return DisplayType.Unknown; }
return XRSubsystemHelpers.DisplaySubsystem.displayOpaque ? DisplayType.Opaque : DisplayType.Transparent;
}
}
Expand Down
11 changes: 8 additions & 3 deletions com.microsoft.mrtk.core/Utilities/DisplayType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ namespace Microsoft.MixedReality.Toolkit
/// </summary>
public enum DisplayType
{
/// <summary>
/// An unknown display type.
/// </summary>
Unknown = 0,

/// <summary>
/// A see-through display that allows the physical world to be viewed.
/// </summary>
Transparent = 0,
Transparent = 1,

/// <summary>
/// A display that blocks viewing of the physical world.
/// </summary>
Opaque = 1
Opaque = 2,
}
}
}
29 changes: 29 additions & 0 deletions com.microsoft.mrtk.input/Assets/Prefabs/MRTK XR Rig.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ GameObject:
- component: {fileID: 5241374001388422442}
- component: {fileID: 2351505566771328560}
- component: {fileID: 2351505566771328561}
- component: {fileID: 404949538145338360}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
Expand Down Expand Up @@ -220,6 +221,34 @@ MonoBehaviour:
m_Flags: 0
m_Flags: 0
m_HasMigratedActions: 1
--- !u!114 &404949538145338360
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2351505566771328562}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 80bee04b0b615324e81420c8aac0dc47, type: 3}
m_Name:
m_EditorClassIdentifier:
opaqueDisplay:
clearMode: 1
clearColor: {r: 0, g: 0, b: 0, a: 1}
nearPlaneDistance: 0.1
farPlaneDistance: 1000
adjustTrackingOrigin: 1
adjustQualityLevel: 1
qualityLevel: 5
transparentDisplay:
clearMode: 2
clearColor: {r: 0, g: 0, b: 0, a: 1}
nearPlaneDistance: 0.1
farPlaneDistance: 50
adjustTrackingOrigin: 1
adjustQualityLevel: 1
qualityLevel: 0
--- !u!1 &2351505566903569413
GameObject:
m_ObjectHideFlags: 0
Expand Down

0 comments on commit bda1893

Please sign in to comment.