FrameInfo.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. namespace EZXR.Glass.Rendering
  2. {
  3. using System;
  4. using UnityEngine;
  5. using System.Runtime.InteropServices;
  6. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  7. public struct FrameInfo
  8. {
  9. [MarshalAs(UnmanagedType.SysInt)]
  10. public IntPtr leftTex;
  11. [MarshalAs(UnmanagedType.SysInt)]
  12. public IntPtr rightTex;
  13. /// <summary> Values that represent the time this twc data aligned with. Unix epoch, second. </summary>
  14. [MarshalAs(UnmanagedType.R8)]
  15. public double TwcTime;
  16. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
  17. public float[] Twc; // Now,it is aligned with EZVIOResult's Twc
  18. /// <summary> Values that represent the time this FrameInfo's textures start rendering. Unix epoch, second. </summary>
  19. [MarshalAs(UnmanagedType.R8)]
  20. public double texStartGenTime;
  21. /// <summary> Values that represent the time the twc data is fetched. Unix epoch, seconds. </summary>
  22. [MarshalAs(UnmanagedType.R8)]
  23. public double TwcFetchTime;
  24. public FrameInfo(IntPtr leftTex, IntPtr rightTex, float[] Twc, double TwcTime, double texStartGenTime, double TwcFetchTime)
  25. {
  26. this.leftTex = leftTex;
  27. this.rightTex = rightTex;
  28. this.Twc = (float[])Twc.Clone();
  29. this.TwcTime = TwcTime;
  30. this.texStartGenTime = texStartGenTime;
  31. this.TwcFetchTime = TwcFetchTime;
  32. }
  33. }
  34. }