version 2.5.1
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine.Profiling;
|
||||
|
||||
//using VIVE.OpenXR.Utils;
|
||||
using VIVE.OpenXR.Hand;
|
||||
@@ -59,20 +60,7 @@ namespace VIVE.OpenXR
|
||||
|
||||
if (m_JointLocations.isActive == 1)
|
||||
{
|
||||
long offset = 0;
|
||||
XrHandJointLocationEXT joint_location_ext_type = default(XrHandJointLocationEXT);
|
||||
|
||||
if (IntPtr.Size == 4)
|
||||
offset = m_JointLocations.jointLocations.ToInt32();
|
||||
else
|
||||
offset = m_JointLocations.jointLocations.ToInt64();
|
||||
|
||||
for (int i = 0; i < m_JointLocations.jointCount; i++)
|
||||
{
|
||||
IntPtr joint_location_ext_ptr = new IntPtr(offset);
|
||||
s_JointLocation[isLeft][i] = (XrHandJointLocationEXT)Marshal.PtrToStructure(joint_location_ext_ptr, typeof(XrHandJointLocationEXT));
|
||||
offset += Marshal.SizeOf(joint_location_ext_type);
|
||||
}
|
||||
MemoryTools.CopyFromRawMemory(handJointLocation, m_JointLocations.jointLocations, (int)m_JointLocations.jointCount);
|
||||
|
||||
handJointLocation = s_JointLocation[isLeft];
|
||||
return true;
|
||||
|
||||
@@ -86,13 +86,8 @@ namespace VIVE.OpenXR
|
||||
{
|
||||
if (ASSERT_FEATURE())
|
||||
{
|
||||
if (feature.GetJointLocations(isLeft, out XrHandJointLocationEXT[] array, out timestamp))
|
||||
if (feature.GetJointLocations(isLeft, out handJointLocation, out timestamp))
|
||||
{
|
||||
if (l_HandJointLocation == null) { l_HandJointLocation = new List<XrHandJointLocationEXT>(); }
|
||||
l_HandJointLocation.Clear();
|
||||
for (int i = 0; i < array.Length; i++) { l_HandJointLocation.Add(array[i]); }
|
||||
|
||||
handJointLocation = l_HandJointLocation.ToArray();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,27 +43,6 @@ namespace VIVE.OpenXR
|
||||
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();
|
||||
@@ -77,10 +56,8 @@ namespace VIVE.OpenXR
|
||||
public override XrFrameState GetFrameState()
|
||||
{
|
||||
ASSERT_FEATURE();
|
||||
#if UNITY_STANDALONE
|
||||
if (feature)
|
||||
return feature.GetFrameState();
|
||||
#endif
|
||||
return new XrFrameState();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user