Skip to content

Commit

Permalink
Fix contextual boundary (#761)
Browse files Browse the repository at this point in the history
* Revert "rename to match the new property name"

This reverts commit 66831bc.

* Enable/disable boundary when passthrough is active

* Defer to oculus project

* Revert "Defer to oculus project"

This reverts commit 5d61e28.
  • Loading branch information
andybak authored Sep 9, 2024
1 parent 2ee490f commit 709a358
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ jobs:
cache: Android_Vulkan
extraoptions: -btb-il2cpp
versionSuffix: 1
extra_defines: OCULUS_SUPPORTED USE_QUEST_PACKAGE_NAME ENABLE_BOUNDARYLESS_APP
extra_defines: OCULUS_SUPPORTED USE_QUEST_PACKAGE_NAME ENABLE_CONTEXTUAL_BOUNDARYLESS_APP

- name: Android Pico
targetPlatform: Android
Expand Down
6 changes: 3 additions & 3 deletions Assets/Editor/BuildTiltBrushPostProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public void OnPostGenerateGradleAndroidProject(string path)
);
#endif

#if ENABLE_BOUNDARYLESS_APP
UnityEngine.Debug.Log("Add com.oculus.feature.BOUNDARYLESS_APP");
#if ENABLE_CONTEXTUAL_BOUNDARYLESS_APP
UnityEngine.Debug.Log("Add com.oculus.feature.CONTEXTUAL_BOUNDARYLESS_APP");
AddOrRemoveTag(doc,
androidNamespaceURI,
"/manifest",
"uses-feature",
"com.oculus.feature.BOUNDARYLESS_APP",
"com.oculus.feature.CONTEXTUAL_BOUNDARYLESS_APP",
true,
true,
"required", "true"
Expand Down
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 709a358

Please sign in to comment.