version 2.5.0

This commit is contained in:
Sean Lu
2024-12-06 15:44:37 +08:00
parent dfdcd0fd7f
commit 2bfa2ad4c7
966 changed files with 238216 additions and 77239 deletions

View File

@@ -1,23 +1,19 @@
using System.Collections;
using System.Collections.Generic;
// Copyright HTC Corporation All Rights Reserved.
using UnityEngine;
using VIVE.OpenXR.CompositionLayer;
using VIVE.OpenXR.CompositionLayer.Passthrough;
using VIVE.OpenXR.Passthrough;
using VIVE.OpenXR.Samples;
namespace VIVE.OpenXR.CompositionLayer.Samples.Passthrough
{
public class PassthroughSample_Planar : MonoBehaviour
{
private int activePassthroughID = 0;
private OpenXR.Passthrough.XrPassthroughHTC activePassthroughID = 0;
private LayerType currentActiveLayerType = LayerType.Underlay;
private void Update()
{
if (VRSInputManager.instance.GetButtonDown(VRSButtonReference.B)) //Set Passthrough as Overlay
{
SetPassthroughToOverlay();
@@ -37,7 +33,7 @@ namespace VIVE.OpenXR.CompositionLayer.Samples.Passthrough
{
if(activePassthroughID != 0)
{
CompositionLayerPassthroughAPI.DestroyPassthrough(activePassthroughID);
PassthroughAPI.DestroyPassthrough(activePassthroughID);
activePassthroughID = 0;
}
}
@@ -47,7 +43,7 @@ namespace VIVE.OpenXR.CompositionLayer.Samples.Passthrough
{
if (activePassthroughID != 0)
{
CompositionLayerPassthroughAPI.SetPassthroughLayerType(activePassthroughID, LayerType.Overlay);
PassthroughAPI.SetPassthroughLayerType(activePassthroughID, LayerType.Overlay);
currentActiveLayerType = LayerType.Overlay;
}
}
@@ -56,19 +52,19 @@ namespace VIVE.OpenXR.CompositionLayer.Samples.Passthrough
{
if (activePassthroughID != 0)
{
CompositionLayerPassthroughAPI.SetPassthroughLayerType(activePassthroughID, LayerType.Underlay);
PassthroughAPI.SetPassthroughLayerType(activePassthroughID, LayerType.Underlay);
currentActiveLayerType = LayerType.Underlay;
}
}
void StartPassthrough()
{
activePassthroughID = CompositionLayerPassthroughAPI.CreatePlanarPassthrough(currentActiveLayerType, OnDestroyPassthroughFeatureSession);
PassthroughAPI.CreatePlanarPassthrough(out activePassthroughID, currentActiveLayerType, OnDestroyPassthroughFeatureSession);
}
void OnDestroyPassthroughFeatureSession(int passthroughID)
void OnDestroyPassthroughFeatureSession(OpenXR.Passthrough.XrPassthroughHTC passthroughID)
{
CompositionLayerPassthroughAPI.DestroyPassthrough(passthroughID);
PassthroughAPI.DestroyPassthrough(passthroughID);
activePassthroughID = 0;
}
}