Skip to content

Commit

Permalink
Enable/disable boundary when passthrough is active
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Sep 8, 2024
1 parent 1e6bc5c commit 50cfaa0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions Assets/Scripts/PassthroughManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ void Start()
#if OCULUS_SUPPORTED
var passthrough = gameObject.AddComponent<OVRPassthroughLayer>();
passthrough.overlayType = OVROverlay.OverlayType.Underlay;
App.VrSdk.m_OvrManager.shouldBoundaryVisibilityBeSuppressed = true;
#endif // OCULUS_SUPPORTED
}

void OnDestroy()
{
#if OCULUS_SUPPORTED
App.VrSdk.m_OvrManager.shouldBoundaryVisibilityBeSuppressed = false;
#endif
}
}
}
12 changes: 7 additions & 5 deletions Assets/Scripts/VrSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public class VrSdk : MonoBehaviour
// out of date for a frame when controllers change.
private VrControllers m_VrControls;
public VrControllers VrControls { get { return m_VrControls; } }

#if OCULUS_SUPPORTED
[NonSerialized] public OVRManager m_OvrManager;
#endif
private bool m_HasVrFocus = true;

private Bounds? m_RoomBoundsAabbCached;
Expand Down Expand Up @@ -204,10 +206,10 @@ void Awake()
// ---------------------------------------------------------------------------------------- //
// OculusVR
// ---------------------------------------------------------------------------------------- //
OVRManager manager = gameObject.AddComponent<OVRManager>();
manager.trackingOriginType = OVRManager.TrackingOrigin.Stage;
manager.useRecommendedMSAALevel = false;
manager.isInsightPassthroughEnabled = true;
m_OvrManager = gameObject.AddComponent<OVRManager>();
m_OvrManager.trackingOriginType = OVRManager.TrackingOrigin.Stage;
m_OvrManager.useRecommendedMSAALevel = false;
m_OvrManager.isInsightPassthroughEnabled = true;

// adding components to the VR Camera needed for fading view and getting controller poses.
m_VrCamera.gameObject.AddComponent<OculusCameraFade>();
Expand Down

0 comments on commit 50cfaa0

Please sign in to comment.