version 2.3.0
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
// Copyright HTC Corporation All Rights Reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VIVE.OpenXR
|
||||
{
|
||||
public class XR_HTC_path_enumeration_defs
|
||||
{
|
||||
public virtual XrResult xrEnumeratePathsForInteractionProfileHTC(
|
||||
ref XrPathsForInteractionProfileEnumerateInfoHTC createInfo,
|
||||
UInt32 pathCapacityInput,
|
||||
ref UInt32 pathCountOutput,
|
||||
[In, Out] XrPath[] paths)
|
||||
{
|
||||
paths = null;
|
||||
return XrResult.XR_ERROR_RUNTIME_FAILURE;
|
||||
}
|
||||
|
||||
public virtual bool GetUserPaths(string interactionProfileString, out XrPath[] userPaths)
|
||||
{
|
||||
userPaths = null;
|
||||
return false;
|
||||
}
|
||||
public virtual bool GetInputPathsWithUserPath(string interactionProfileString, XrPath userPath, out XrPath[] inputPaths)
|
||||
{
|
||||
inputPaths = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual string PathToString(ulong path) { return null; }
|
||||
public virtual ulong StringToPath(string str) {
|
||||
return 0; }
|
||||
}
|
||||
|
||||
public static class XR_HTC_path_enumeration
|
||||
{
|
||||
static XR_HTC_path_enumeration_defs m_Instance = null;
|
||||
public static XR_HTC_path_enumeration_defs Interop
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Instance == null)
|
||||
{
|
||||
m_Instance = new XR_HTC_path_enumeration_impls();
|
||||
}
|
||||
return m_Instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static XrResult xrEnumeratePathsForInteractionProfileHTC(
|
||||
ref XrPathsForInteractionProfileEnumerateInfoHTC createInfo,
|
||||
UInt32 pathCapacityInput,
|
||||
ref UInt32 pathCountOutput,
|
||||
[In, Out] XrPath[] paths)
|
||||
{
|
||||
return Interop.xrEnumeratePathsForInteractionProfileHTC(ref createInfo,
|
||||
pathCapacityInput,
|
||||
ref pathCountOutput,
|
||||
paths);
|
||||
}
|
||||
|
||||
public static string PathToString(ulong path) { return Interop.PathToString(path); }
|
||||
public static ulong StringToPath(string str)
|
||||
{
|
||||
return Interop.StringToPath(str); }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be103afd6857e52418eed1936213db83
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,104 @@
|
||||
// Copyright HTC Corporation All Rights Reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.OpenXR;
|
||||
namespace VIVE.OpenXR
|
||||
{
|
||||
public class XR_HTC_path_enumeration_impls : XR_HTC_path_enumeration_defs
|
||||
{
|
||||
const string LOG_TAG = "VIVE.OpenXR.XR_HTC_path_enumeration_impls";
|
||||
void DEBUG(string msg) { Debug.Log(LOG_TAG + " " + msg); }
|
||||
public XR_HTC_path_enumeration_impls() { DEBUG("XR_HTC_path_enumeration_impls()"); }
|
||||
private VivePathEnumeration feature = null;
|
||||
|
||||
private void ASSERT_FEATURE()
|
||||
{
|
||||
if (feature == null) { feature = OpenXRSettings.Instance.GetFeature<VivePathEnumeration>(); }
|
||||
}
|
||||
|
||||
public override XrResult xrEnumeratePathsForInteractionProfileHTC(
|
||||
ref XrPathsForInteractionProfileEnumerateInfoHTC createInfo,
|
||||
UInt32 pathCapacityInput,
|
||||
ref UInt32 pathCountOutput,
|
||||
[In, Out] XrPath[] paths)
|
||||
{
|
||||
DEBUG("xrEnumeratePathsForInteractionProfileHTC");
|
||||
XrResult result = XrResult.XR_ERROR_VALIDATION_FAILURE;
|
||||
ASSERT_FEATURE();
|
||||
if (feature)
|
||||
{
|
||||
result = feature.EnumeratePathsForInteractionProfileHTC(ref createInfo, pathCapacityInput,
|
||||
ref pathCountOutput, paths);
|
||||
if (result != XrResult.XR_SUCCESS) { paths = null; }
|
||||
}
|
||||
paths = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
public override bool GetUserPaths(string interactionProfileString, out XrPath[] userPaths)
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
if (feature)
|
||||
{
|
||||
if (feature.GetUserPaths(interactionProfileString, out userPaths))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
userPaths = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
userPaths = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool GetInputPathsWithUserPath(string interactionProfileString, XrPath userPath, out XrPath[] inputPaths)
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
if (feature)
|
||||
{
|
||||
if (feature.GetInputPathsWithUserPath(interactionProfileString, userPath,out inputPaths))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
inputPaths = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inputPaths = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override string PathToString(ulong path)
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
if (feature)
|
||||
return feature.xrPathToString(path);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
public override ulong StringToPath(string str)
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
if (feature)
|
||||
return feature.xrStringToPath(str);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0778892173385d4291570f9f47ec08d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user