version 2.4.0
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using VIVE.OpenXR.CompositionLayer;
|
||||
using VIVE.OpenXR.CompositionLayer.Passthrough;
|
||||
|
||||
namespace VIVE.OpenXR
|
||||
{
|
||||
public class XR_HTC_passthrough_defs
|
||||
{
|
||||
public virtual XrResult xrCreatePassthroughHTC(XrPassthroughCreateInfoHTC createInfo, out XrPassthroughHTC passthrough)
|
||||
{
|
||||
passthrough = 0;
|
||||
return XrResult.XR_ERROR_RUNTIME_FAILURE;
|
||||
}
|
||||
public virtual XrResult xrDestroyPassthroughHTC(XrPassthroughHTC passthrough)
|
||||
{
|
||||
return XrResult.XR_ERROR_RUNTIME_FAILURE;
|
||||
}
|
||||
|
||||
public virtual void GetOriginEndFrameLayerList(out List<IntPtr> layers)
|
||||
{
|
||||
layers = new List<IntPtr>();
|
||||
}
|
||||
|
||||
public virtual void SubmitLayers(List<IntPtr> layers)
|
||||
{
|
||||
}
|
||||
public virtual XrSpace GetTrackingSpace()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual XrFrameState GetFrameState()
|
||||
{
|
||||
return new XrFrameState();
|
||||
}
|
||||
|
||||
}
|
||||
public static class XR_HTC_passthrough
|
||||
{
|
||||
static XR_HTC_passthrough_defs m_Instance = null;
|
||||
public static XR_HTC_passthrough_defs Interop
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Instance == null)
|
||||
{
|
||||
m_Instance = new XR_HTC_passthrough_impls();
|
||||
}
|
||||
return m_Instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static XrResult xrCreatePassthroughHTC(XrPassthroughCreateInfoHTC createInfo, out XrPassthroughHTC passthrough)
|
||||
{
|
||||
return Interop.xrCreatePassthroughHTC(createInfo,out passthrough);
|
||||
}
|
||||
public static XrResult xrDestroyPassthroughHTC(XrPassthroughHTC passthrough)
|
||||
{
|
||||
return Interop.xrDestroyPassthroughHTC(passthrough);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 099596ee936f4724f866de5335ef9cf6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.OpenXR;
|
||||
using VIVE.OpenXR.CompositionLayer;
|
||||
using VIVE.OpenXR.CompositionLayer.Passthrough;
|
||||
|
||||
namespace VIVE.OpenXR
|
||||
{
|
||||
public class XR_HTC_passthrough_impls : XR_HTC_passthrough_defs
|
||||
{
|
||||
const string LOG_TAG = "VIVE.OpenXR.XR_HTC_passthrough_impls";
|
||||
void DEBUG(string msg) { Debug.Log(LOG_TAG + " " + msg); }
|
||||
public XR_HTC_passthrough_impls() { DEBUG("XR_HTC_passthrough_impls()"); }
|
||||
private ViveCompositionLayerPassthrough feature = null;
|
||||
|
||||
private void ASSERT_FEATURE()
|
||||
{
|
||||
if (feature == null) { feature = OpenXRSettings.Instance.GetFeature<ViveCompositionLayerPassthrough>(); }
|
||||
}
|
||||
|
||||
public override XrResult xrCreatePassthroughHTC(XrPassthroughCreateInfoHTC createInfo, out XrPassthroughHTC passthrough)
|
||||
{
|
||||
XrResult result = XrResult.XR_ERROR_VALIDATION_FAILURE;
|
||||
passthrough = 0;
|
||||
ASSERT_FEATURE();
|
||||
#if UNITY_STANDALONE
|
||||
if(feature)
|
||||
result = feature.CreatePassthroughHTC(createInfo,out passthrough);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
public override XrResult xrDestroyPassthroughHTC(XrPassthroughHTC passthrough)
|
||||
{
|
||||
XrResult result = XrResult.XR_ERROR_VALIDATION_FAILURE;
|
||||
ASSERT_FEATURE();
|
||||
#if UNITY_STANDALONE
|
||||
if(feature)
|
||||
result = feature.DestroyPassthroughHTC(passthrough);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
public override void GetOriginEndFrameLayerList(out List<IntPtr> layers)
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
layers = new List<IntPtr>();
|
||||
#if UNITY_STANDALONE
|
||||
if (feature)
|
||||
feature.GetOriginEndFrameLayerList(out layers);
|
||||
|
||||
else
|
||||
layers = new List<IntPtr>();
|
||||
#endif
|
||||
}
|
||||
public override void SubmitLayers(List<IntPtr> layers)
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
#if UNITY_STANDALONE
|
||||
if (feature)
|
||||
feature.SubmitLayers(layers);
|
||||
#endif
|
||||
}
|
||||
|
||||
public override XrSpace GetTrackingSpace()
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
#if UNITY_STANDALONE
|
||||
if (feature)
|
||||
return feature.GetTrackingSpace();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override XrFrameState GetFrameState()
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
#if UNITY_STANDALONE
|
||||
if (feature)
|
||||
return feature.GetFrameState();
|
||||
#endif
|
||||
return new XrFrameState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97968beb8cc921d4cbebb8e3a2bc3d6c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user