GSXRPluginWin.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. using UnityEngine;
  2. using System;
  3. using System.Collections;
  4. using System.Runtime.InteropServices;
  5. using SC.XR.Unity;
  6. using SC.XR.Unity.Module_InputSystem.InputDeviceGC.KS;
  7. class GSXRPluginWin : GSXRPlugin
  8. {
  9. public static GSXRPluginWin Create()
  10. {
  11. return new GSXRPluginWin ();
  12. }
  13. private GSXRPluginWin() { }
  14. public override bool IsInitialized() { return slamManager != null; }
  15. public override bool IsRunning() { return eyes != null; }
  16. bool isUseSingleView = true;
  17. public override IEnumerator Initialize()
  18. {
  19. yield return base.Initialize();
  20. deviceInfo = GetDeviceInfo();
  21. if (API_Module_SDKConfiguration.HasKey("Module_Slam", "isUseSingleView")) {
  22. isUseSingleView = API_Module_SDKConfiguration.GetBool("Module_Slam", "isUseSingleView", 1);
  23. DebugMy.Log("isUseSingleView:" + isUseSingleView, this, true);
  24. }
  25. yield break;
  26. }
  27. public override IEnumerator BeginVr(int cpuPerfLevel, int gpuPerfLevel)
  28. {
  29. yield return base.BeginVr(cpuPerfLevel, gpuPerfLevel);
  30. yield break;
  31. }
  32. public override void SetVSyncCount(int vSyncCount)
  33. {
  34. QualitySettings.vSyncCount = vSyncCount;
  35. }
  36. Vector2 mouseNDCRotate = Vector2.zero;
  37. Vector2 mouseNDCPosition = Vector2.zero;
  38. Vector2 mousePressPointTemp1 = Vector2.zero;
  39. Vector3 mousePressEuler = Vector3.zero;
  40. public override int GetHeadPose(ref HeadPose headPose, int frameIndex)
  41. {
  42. int poseStatus = 0;
  43. headPose.orientation = Quaternion.identity;
  44. headPose.position = Vector3.zero;
  45. //Debug.Log("Input.mousePosition:"+ Input.mousePosition+" "+ Screen.width+" "+Screen.height);
  46. //if (Input.GetMouseButton(0)) // 0/Left mouse button
  47. //{
  48. // poseStatus |= (int)TrackingMode.kTrackingOrientation;
  49. // poseStatus |= (int)TrackingMode.kTrackingPosition;
  50. //}
  51. //if(Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) // 1/Right mouse button
  52. //{
  53. // mousePressPointTemp1 = Input.mousePosition;
  54. // mousePressEuler = Camera.main.transform.eulerAngles;
  55. //} else if(Input.GetMouseButton(0) || Input.GetMouseButton(1)) {
  56. // mouseNDCRotate.x = 2 * ((Input.mousePosition.x - mousePressPointTemp1.x) / Screen.width) ;
  57. // mouseNDCRotate.y = 2 * ((Input.mousePosition.y - mousePressPointTemp1.y) / Screen.height) ;
  58. // poseStatus |= (int)TrackingMode.kTrackingOrientation;
  59. //}
  60. //if(Input.GetKey(KeyCode.W)) {
  61. // mouseNDCPosition.y += Time.deltaTime * 0.2f;
  62. // poseStatus |= (int)TrackingMode.kTrackingPosition;
  63. //} else if(Input.GetKey(KeyCode.S)) {
  64. // mouseNDCPosition.y -= Time.deltaTime * 0.2f;
  65. // poseStatus |= (int)TrackingMode.kTrackingPosition;
  66. //} else {
  67. // mouseNDCPosition.y = 0;
  68. //}
  69. //if(Input.GetKey(KeyCode.A)) {
  70. // mouseNDCPosition.x -= Time.deltaTime * 0.2f;
  71. // poseStatus |= (int)TrackingMode.kTrackingPosition;
  72. //} else if(Input.GetKey(KeyCode.D)) {
  73. // mouseNDCPosition.x += Time.deltaTime * 0.2f;
  74. // poseStatus |= (int)TrackingMode.kTrackingPosition;
  75. //} else {
  76. // mouseNDCPosition.x = 0;
  77. //}
  78. ////if(Input.mouseScrollDelta.y != 0) {
  79. //// mouseNDCPosition.x = 0;
  80. //// mouseNDCPosition.y = Input.mouseScrollDelta.y * 0.2f;
  81. //// poseStatus |= (int)TrackingMode.kTrackingPosition;
  82. ////} else {
  83. //// mouseNDCPosition = Vector2.zero;
  84. ////}
  85. /////复位
  86. //if(Input.GetKey(KeyCode.Escape) == true) {
  87. // mouseNDCRotate = Vector2.zero;
  88. // mouseNDCPosition = Vector2.zero;
  89. // mousePressPointTemp1 = Vector2.zero;
  90. // mousePressEuler = Vector3.zero;
  91. // Camera.main.transform.position = Vector3.zero;
  92. // poseStatus |= (int)TrackingMode.kTrackingOrientation;
  93. // poseStatus |= (int)TrackingMode.kTrackingPosition;
  94. //}
  95. headPose.orientation.eulerAngles = mousePressEuler + new Vector3(-mouseNDCRotate.y * 45f, mouseNDCRotate.x * 90f, 0);
  96. headPose.position = new Vector3(mouseNDCPosition.x,0, mouseNDCPosition.y);
  97. headPose.position = Camera.main.transform.TransformPoint(headPose.position);
  98. return poseStatus;
  99. }
  100. public override DeviceInfo GetDeviceInfo()
  101. {
  102. DeviceInfo info = new DeviceInfo();
  103. info.displayWidthPixels = Screen.width;
  104. info.displayHeightPixels = Screen.height;
  105. info.displayRefreshRateHz = 60.0f;
  106. info.targetEyeWidthPixels = info.displayWidthPixels;
  107. info.targetEyeHeightPixels = info.displayHeightPixels;
  108. info.targetFovXRad = Mathf.Deg2Rad * 47;
  109. info.targetFovYRad = Mathf.Deg2Rad * 20.1f;
  110. info.targetFrustumLeft.left = -0.02208847f;
  111. info.targetFrustumLeft.right = 0.02208847f;
  112. info.targetFrustumLeft.top = 0.0123837f;
  113. info.targetFrustumLeft.bottom = -0.0123837f;
  114. info.targetFrustumLeft.near = 0.0508f;
  115. info.targetFrustumLeft.far = 100f;
  116. info.targetFrustumRight.left = -0.02208847f;
  117. info.targetFrustumRight.right = 0.02208847f;
  118. info.targetFrustumRight.top = 0.0123837f;
  119. info.targetFrustumRight.bottom = -0.0123837f;
  120. info.targetFrustumRight.near = 0.0508f;
  121. info.targetFrustumRight.far = 100f;
  122. return info;
  123. }
  124. public override void SubmitFrame(int frameIndex, float fieldOfView, int frameType)
  125. {
  126. RenderTexture.active = null;
  127. GL.Clear (false, true, Color.black);
  128. //float cameraFov = fieldOfView;
  129. //float fovMarginX = (cameraFov / deviceInfo.targetFovXRad) - 1;
  130. //float fovMarginY = (cameraFov / deviceInfo.targetFovYRad) - 1;
  131. //Rect textureRect = new Rect(fovMarginX * 0.5f, fovMarginY * 0.5f, 1 - fovMarginX, 1 - fovMarginY);
  132. Rect textureRect = new Rect(0, 0, 1, 1);
  133. Vector2 leftCenter = new Vector2(Screen.width * 0.25f, Screen.height * 0.5f);
  134. Vector2 rightCenter = new Vector2(Screen.width * 0.75f, Screen.height * 0.5f);
  135. Vector2 eyeExtent = new Vector3(Screen.width * 0.25f, Screen.height * 0.5f);
  136. eyeExtent.x -= 10.0f;
  137. eyeExtent.y -= 10.0f;
  138. Rect leftScreen = Rect.MinMaxRect(
  139. leftCenter.x - eyeExtent.x,
  140. leftCenter.y - eyeExtent.y,
  141. leftCenter.x + eyeExtent.x,
  142. leftCenter.y + eyeExtent.y);
  143. Rect rightScreen = Rect.MinMaxRect(
  144. rightCenter.x - eyeExtent.x,
  145. rightCenter.y - eyeExtent.y,
  146. rightCenter.x + eyeExtent.x,
  147. rightCenter.y + eyeExtent.y);
  148. if (eyes != null && isUseSingleView) {
  149. for (int i = 0; i < eyes.Length; i++) {
  150. if (eyes[i].isActiveAndEnabled == false) continue;
  151. if (eyes[i].TexturePtr == null) continue;
  152. if (eyes[i].imageTransform != null && eyes[i].imageTransform.gameObject.activeSelf == false) continue;
  153. if (eyes[i].imageTransform != null && !eyes[i].imageTransform.IsChildOf(slamManager.transform)) continue;
  154. var eyeRectMin = eyes[i].clipLowerLeft; eyeRectMin /= eyeRectMin.w;
  155. var eyeRectMax = eyes[i].clipUpperRight; eyeRectMax /= eyeRectMax.w;
  156. if (eyes[i].Side == GSXREye.eSide.Left) {
  157. leftScreen = Rect.MinMaxRect(
  158. 0, 0, Screen.width, Screen.height);
  159. Graphics.DrawTexture(leftScreen, eyes[i].TexturePtr, textureRect, 0, 0, 0, 0);
  160. return;
  161. }
  162. }
  163. }
  164. if (eyes != null) for (int i = 0; i < eyes.Length; i++)
  165. {
  166. if (eyes[i].isActiveAndEnabled == false) continue;
  167. if (eyes[i].TexturePtr == null) continue;
  168. if (eyes[i].imageTransform != null && eyes[i].imageTransform.gameObject.activeSelf == false) continue;
  169. if (eyes[i].imageTransform != null && !eyes[i].imageTransform.IsChildOf(slamManager.transform)) continue;
  170. var eyeRectMin = eyes[i].clipLowerLeft; eyeRectMin /= eyeRectMin.w;
  171. var eyeRectMax = eyes[i].clipUpperRight; eyeRectMax /= eyeRectMax.w;
  172. if (eyes[i].Side == GSXREye.eSide.Left || eyes[i].Side == GSXREye.eSide.Both)
  173. {
  174. leftScreen = Rect.MinMaxRect(
  175. leftCenter.x + eyeExtent.x * eyeRectMin.x,
  176. leftCenter.y + eyeExtent.y * eyeRectMin.y,
  177. leftCenter.x + eyeExtent.x * eyeRectMax.x,
  178. leftCenter.y + eyeExtent.y * eyeRectMax.y);
  179. Graphics.DrawTexture(leftScreen, eyes[i].TexturePtr, textureRect, 0, 0, 0, 0);
  180. }
  181. if (eyes[i].Side == GSXREye.eSide.Right || eyes[i].Side == GSXREye.eSide.Both)
  182. {
  183. rightScreen = Rect.MinMaxRect(
  184. rightCenter.x + eyeExtent.x * eyeRectMin.x,
  185. rightCenter.y + eyeExtent.y * eyeRectMin.y,
  186. rightCenter.x + eyeExtent.x * eyeRectMax.x,
  187. rightCenter.y + eyeExtent.y * eyeRectMax.y);
  188. Graphics.DrawTexture(rightScreen, eyes[i].TexturePtr, textureRect, 0, 0, 0, 0);
  189. }
  190. }
  191. if (overlays != null) for (int i = 0; i < overlays.Length; i++)
  192. {
  193. if (overlays[i].isActiveAndEnabled == false) continue;
  194. if (overlays[i].TexturePtr == null) continue;
  195. if (overlays[i].imageTransform != null && overlays[i].imageTransform.gameObject.activeSelf == false) continue;
  196. if (overlays[i].imageTransform != null && !overlays[i].imageTransform.IsChildOf(slamManager.transform)) continue;
  197. var eyeRectMin = overlays[i].clipLowerLeft; eyeRectMin /= eyeRectMin.w;
  198. var eyeRectMax = overlays[i].clipUpperRight; eyeRectMax /= eyeRectMax.w;
  199. textureRect.Set(overlays[i].uvLowerLeft.x, overlays[i].uvLowerLeft.y,
  200. overlays[i].uvUpperRight.x - overlays[i].uvLowerLeft.x,
  201. overlays[i].uvUpperRight.y - overlays[i].uvLowerLeft.y);
  202. if (overlays[i].Side == GSXROverlay.eSide.Left || overlays[i].Side == GSXROverlay.eSide.Both)
  203. {
  204. leftScreen = Rect.MinMaxRect(
  205. leftCenter.x + eyeExtent.x * eyeRectMin.x,
  206. leftCenter.y + eyeExtent.y * eyeRectMin.y,
  207. leftCenter.x + eyeExtent.x * eyeRectMax.x,
  208. leftCenter.y + eyeExtent.y * eyeRectMax.y);
  209. Graphics.DrawTexture(leftScreen, overlays[i].TexturePtr, textureRect, 0, 0, 0, 0);
  210. }
  211. if (overlays[i].Side == GSXROverlay.eSide.Right || overlays[i].Side == GSXROverlay.eSide.Both)
  212. {
  213. rightScreen = Rect.MinMaxRect(
  214. rightCenter.x + eyeExtent.x * eyeRectMin.x,
  215. rightCenter.y + eyeExtent.y * eyeRectMin.y,
  216. rightCenter.x + eyeExtent.x * eyeRectMax.x,
  217. rightCenter.y + eyeExtent.y * eyeRectMax.y);
  218. Graphics.DrawTexture(rightScreen, overlays[i].TexturePtr, textureRect, 0, 0, 0, 0);
  219. }
  220. }
  221. }
  222. public override void Shutdown()
  223. {
  224. base.Shutdown();
  225. }
  226. #region Controller
  227. public override bool GSXR_Is_SupportController() { return true; }
  228. public override int GSXR_Get_ControllerList() { return (int)KSID.K102; }
  229. #endregion Controller
  230. #region HandTracking
  231. public override bool GSXR_Is_SupportHandTracking() {return true;}
  232. float[] poseNull = new float[3] { 0, 0, 0 };
  233. public override void GSXR_Get_HandTrackingData(float[] mode, float[] pose) {
  234. pose = poseNull;
  235. #region PCgesture
  236. if (Input.GetKey(KeyCode.Alpha1) == true && Input.GetKey(KeyCode.Alpha2) == false) {
  237. ///左手抓取手型数据
  238. Array.Copy(DataLeftCatch, mode, DataLeftCatch.Length);
  239. } else if ((Input.GetKey(KeyCode.Alpha1) == false && Input.GetKey(KeyCode.Alpha2)) == true) {
  240. ///右手手抓取手型数据
  241. Array.Copy(DataRightCatch, mode, DataLeftCatch.Length);
  242. } else if (Input.GetMouseButton(0) || Input.GetKey(KeyCode.Alpha1) == true && Input.GetKey(KeyCode.Alpha2) == true) {
  243. ///双手抓取手型数据
  244. Array.Copy(DataBothCatch, mode, DataLeftCatch.Length);
  245. } else {
  246. ///正常张开手型数据
  247. Array.Copy(DataBothRelease, mode, DataLeftCatch.Length);
  248. }
  249. #endregion
  250. //if(Input.GetKey(KeyCode.W) == true) {
  251. // temp +=Vector3.forward* Time.deltaTime * 0.1f;
  252. //}
  253. //if(Input.GetKey(KeyCode.A) == true) {
  254. // temp += Vector3.left * Time.deltaTime * 0.1f;
  255. //}
  256. //if(Input.GetKey(KeyCode.D) == true) {
  257. // temp += Vector3.right * Time.deltaTime * 0.1f;
  258. //}
  259. //if(Input.GetKey(KeyCode.S) == true) {
  260. // temp += Vector3.back * Time.deltaTime * 0.1f;
  261. //}
  262. //pose[0] = temp.x;
  263. //pose[1] = temp.y;
  264. //pose[2] = temp.z;
  265. }
  266. float[] DataLeftCatch = new float[256] {
  267. 2f,
  268. 1f,
  269. 21f,
  270. -0.05605574f , -0.0273f , 0.314f,
  271. -0.07f , -0.0447f , 0.3f ,
  272. -0.09515104f , -0.05433898f , 0.2831757f,
  273. -0.1463438f , -0.06028023f , 0.2818089f,
  274. -0.0519f , -0.0216f , 0.3217f,
  275. -0.06158409f , -0.0002f , 0.3183799f,
  276. -0.07964747f , 0.0028f , 0.3071041f,
  277. -0.09945723f , -0.008320909f , 0.2969252f,
  278. -0.06198902f , -0.0038f , 0.3519928f ,
  279. -0.07581183f , 0.0061f , 0.3419357f ,
  280. -0.09352214f , 0.0082f , 0.3285346f ,
  281. -0.1137585f , -0.002121262f , 0.3150989f,
  282. -0.07718303f , -0.0063f , 0.364556f,
  283. -0.08849367f , 0.0018f , 0.3556355f,
  284. -0.1056515f , 0.0004f , 0.3442511f,
  285. -0.1236217f , -0.008046876f , 0.331872f,
  286. -0.09772705f , -0.0135f , 0.3714658f,
  287. -0.1064803f , -0.0118f , 0.3659644f,
  288. -0.1201454f , -0.0166f , 0.3570033f ,
  289. -0.1347919f , -0.02225832f , 0.3441104f,
  290. -0.1562702f , -0.05975028f , 0.2943733f ,
  291. 2f,
  292. 21f,
  293. 0.01329147f , -0.05185008f , 0.2831516f,
  294. 0.02629676f , -0.05859572f , 0.2733593f ,
  295. 0.04144813f , -0.06611566f , 0.2669144f,
  296. 0.09289996f , -0.07803007f , 0.2608919f,
  297. 0.008512383f , 0.008053687f , 0.2999706f,
  298. 0.0184048f , 0.004125214f , 0.2896651f ,
  299. 0.0309000f , -0.00680000f , 0.27900000f ,
  300. 0.05151144f , -0.02237571f , 0.2674141f,
  301. 0.02381282f , 0.02699578f , 0.3218553f,
  302. 0.03562622f , 0.01996369f , 0.3106135f,
  303. 0.05122653f , 0.008665001f , 0.2939393f,
  304. 0.06585947f , -0.01085604f , 0.2825926f,
  305. 0.04237749f , 0.01809751f , 0.3312246f ,
  306. 0.05178002f , 0.01224715f , 0.3221904f,
  307. 0.0659532f , 0.003831701f , 0.3083498f,
  308. 0.07914048f , -0.01247946f , 0.296542f,
  309. 0.06218155f , 0.002945414f , 0.3410454f ,
  310. 0.07016665f , -0.002003442f , 0.3339252f,
  311. 0.08204032f , -0.01003692f , 0.322701f,
  312. 0.09209882f , -0.02350484f , 0.3101943f ,
  313. 0.1055621f , -0.07391939f , 0.2699004f ,
  314. 0,
  315. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  316. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  317. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  318. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  319. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  320. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  321. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  322. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  323. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  324. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  325. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  326. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  327. 0,0,0,0
  328. };
  329. float[] DataRightCatch = new float[256] {
  330. 2f,
  331. 1f,
  332. 21f,
  333. -0.05605574f , -0.04518472f , 0.2970701f,
  334. -0.07650252f , -0.04899639f , 0.2892286f ,
  335. -0.09515104f , -0.05433898f , 0.2831757f,
  336. -0.1463438f , -0.06028023f , 0.2818089f,
  337. -0.04933745f , 0.01041036f , 0.3268114f,
  338. -0.06158409f , 0.009036704f , 0.3183799f,
  339. -0.07964747f , 0.0015f , 0.3071041f,
  340. -0.09945723f , -0.008320909f , 0.2969252f,
  341. -0.06198902f , 0.02461821f , 0.3519928f ,
  342. -0.07581183f , 0.02041251f , 0.3419357f ,
  343. -0.09352214f , 0.01374155f , 0.3285346f ,
  344. -0.1137585f , -0.002121262f , 0.3150989f,
  345. -0.07718303f , 0.01460867f , 0.364556f,
  346. -0.08849367f , 0.01155128f , 0.3556355f,
  347. -0.1056515f , 0.005635553f , 0.3442511f,
  348. -0.1236217f , -0.008046876f , 0.331872f,
  349. -0.09772705f , -0.003397862f , 0.3714658f,
  350. -0.1064803f , -0.005923742f , 0.3659644f,
  351. -0.1201454f , -0.01133183f , 0.3570033f ,
  352. -0.1347919f , -0.02225832f , 0.3441104f,
  353. -0.1562702f , -0.05975028f , 0.2943733f ,
  354. 2f,
  355. 21f,
  356. 0.0159f , -0.0299f , 0.2831516f,
  357. 0.0348f , -0.0511f , 0.2733593f ,
  358. 0.0491f , -0.0602f , 0.2669144f,
  359. 0.09289996f , -0.07803007f , 0.2608919f,
  360. 0.0085f , -0.0223f , 0.2917f,
  361. 0.0184f , -0.0117f , 0.28966f ,
  362. 0.0338265f , -0.0106f , 0.2750752f ,
  363. 0.05151144f , -0.02237571f , 0.2674141f,
  364. 0.02381282f , -0.005f , 0.3218553f,
  365. 0.03562622f , 0.0052f , 0.3106135f,
  366. 0.05122653f , 0.0032f , 0.2939393f,
  367. 0.06585947f , -0.01085604f , 0.2825926f,
  368. 0.04237749f , 0.002f , 0.3312246f ,
  369. 0.05178002f , 0.0005f , 0.3221904f,
  370. 0.0659532f , -0.002f , 0.3083498f,
  371. 0.07914048f , -0.01247946f , 0.296542f,
  372. 0.06218155f , 0.002945414f , 0.3410454f ,
  373. 0.07016665f , -0.002003442f , 0.3339252f,
  374. 0.08204032f , -0.01003692f , 0.322701f,
  375. 0.09209882f , -0.02350484f , 0.3101943f ,
  376. 0.1055621f , -0.07391939f , 0.2699004f ,
  377. 0,
  378. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  379. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  380. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  381. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  382. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  383. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  384. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  385. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  386. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  387. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  388. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  389. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  390. 0,0,0,0
  391. };
  392. float[] DataBothCatch = new float[256] {
  393. 2f,
  394. 1f,
  395. 21f,
  396. -0.05605574f , -0.0273f , 0.314f,
  397. -0.07f , -0.0447f , 0.3f ,
  398. -0.09515104f , -0.05433898f , 0.2831757f,
  399. -0.1463438f , -0.06028023f , 0.2818089f,
  400. -0.0519f , -0.0216f , 0.3217f,
  401. -0.06158409f , -0.0002f , 0.3183799f,
  402. -0.07964747f , 0.0028f , 0.3071041f,
  403. -0.09945723f , -0.008320909f , 0.2969252f,
  404. -0.06198902f , -0.0038f , 0.3519928f ,
  405. -0.07581183f , 0.0061f , 0.3419357f ,
  406. -0.09352214f , 0.0082f , 0.3285346f ,
  407. -0.1137585f , -0.002121262f , 0.3150989f,
  408. -0.07718303f , -0.0063f , 0.364556f,
  409. -0.08849367f , 0.0018f , 0.3556355f,
  410. -0.1056515f , 0.0004f , 0.3442511f,
  411. -0.1236217f , -0.008046876f , 0.331872f,
  412. -0.09772705f , -0.0135f , 0.3714658f,
  413. -0.1064803f , -0.0118f , 0.3659644f,
  414. -0.1201454f , -0.0166f , 0.3570033f ,
  415. -0.1347919f , -0.02225832f , 0.3441104f,
  416. -0.1562702f , -0.05975028f , 0.2943733f ,
  417. 2f,
  418. 21f,
  419. 0.0159f , -0.0299f , 0.2831516f,
  420. 0.0348f , -0.0511f , 0.2733593f ,
  421. 0.0491f , -0.0602f , 0.2669144f,
  422. 0.09289996f , -0.07803007f , 0.2608919f,
  423. 0.0085f , -0.0223f , 0.2917f,
  424. 0.0184f , -0.0117f , 0.28966f ,
  425. 0.0338265f , -0.0106f , 0.2750752f ,
  426. 0.05151144f , -0.02237571f , 0.2674141f,
  427. 0.02381282f , -0.005f , 0.3218553f,
  428. 0.03562622f , 0.0052f , 0.3106135f,
  429. 0.05122653f , 0.0032f , 0.2939393f,
  430. 0.06585947f , -0.01085604f , 0.2825926f,
  431. 0.04237749f , 0.002f , 0.3312246f ,
  432. 0.05178002f , 0.0005f , 0.3221904f,
  433. 0.0659532f , -0.002f , 0.3083498f,
  434. 0.07914048f , -0.01247946f , 0.296542f,
  435. 0.06218155f , 0.002945414f , 0.3410454f ,
  436. 0.07016665f , -0.002003442f , 0.3339252f,
  437. 0.08204032f , -0.01003692f , 0.322701f,
  438. 0.09209882f , -0.02350484f , 0.3101943f ,
  439. 0.1055621f , -0.07391939f , 0.2699004f ,
  440. 0,
  441. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  442. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  443. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  444. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  445. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  446. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  447. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  448. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  449. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  450. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  451. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  452. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  453. 0,0,0,0
  454. };
  455. float[] DataBothRelease = new float[256] {
  456. 2f,
  457. 1f,
  458. 21f,
  459. -0.05605574f , -0.04518472f , 0.2970701f,
  460. -0.07650252f , -0.04899639f , 0.2892286f ,
  461. -0.09515104f , -0.05433898f , 0.2831757f,
  462. -0.1463438f , -0.06028023f , 0.2818089f,
  463. -0.04933745f , 0.01041036f , 0.3268114f,
  464. -0.06158409f , 0.009036704f , 0.3183799f,
  465. -0.07964747f , 0.0015f , 0.3071041f,
  466. -0.09945723f , -0.008320909f , 0.2969252f,
  467. -0.06198902f , 0.02461821f , 0.3519928f ,
  468. -0.07581183f , 0.02041251f , 0.3419357f ,
  469. -0.09352214f , 0.01374155f , 0.3285346f ,
  470. -0.1137585f , -0.002121262f , 0.3150989f,
  471. -0.07718303f , 0.01460867f , 0.364556f,
  472. -0.08849367f , 0.01155128f , 0.3556355f,
  473. -0.1056515f , 0.005635553f , 0.3442511f,
  474. -0.1236217f , -0.008046876f , 0.331872f,
  475. -0.09772705f , -0.003397862f , 0.3714658f,
  476. -0.1064803f , -0.005923742f , 0.3659644f,
  477. -0.1201454f , -0.01133183f , 0.3570033f ,
  478. -0.1347919f , -0.02225832f , 0.3441104f,
  479. -0.1562702f , -0.05975028f , 0.2943733f ,
  480. 2f,
  481. 21f,
  482. 0.01329147f , -0.05185008f , 0.2831516f,
  483. 0.02629676f , -0.05859572f , 0.2733593f ,
  484. 0.04144813f , -0.06611566f , 0.2669144f,
  485. 0.09289996f , -0.07803007f , 0.2608919f,
  486. 0.008512383f , 0.008053687f , 0.2999706f,
  487. 0.0184048f , 0.004125214f , 0.2896651f ,
  488. 0.0309000f , -0.00680000f , 0.27900000f ,
  489. 0.05151144f , -0.02237571f , 0.2674141f,
  490. 0.02381282f , 0.02699578f , 0.3218553f,
  491. 0.03562622f , 0.01996369f , 0.3106135f,
  492. 0.05122653f , 0.008665001f , 0.2939393f,
  493. 0.06585947f , -0.01085604f , 0.2825926f,
  494. 0.04237749f , 0.01809751f , 0.3312246f ,
  495. 0.05178002f , 0.01224715f , 0.3221904f,
  496. 0.0659532f , 0.003831701f , 0.3083498f,
  497. 0.07914048f , -0.01247946f , 0.296542f,
  498. 0.06218155f , 0.002945414f , 0.3410454f ,
  499. 0.07016665f , -0.002003442f , 0.3339252f,
  500. 0.08204032f , -0.01003692f , 0.322701f,
  501. 0.09209882f , -0.02350484f , 0.3101943f ,
  502. 0.1055621f , -0.07391939f , 0.2699004f ,
  503. 0,
  504. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  505. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  506. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  507. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  508. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  509. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  510. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  511. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  512. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  513. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  514. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  515. 0,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,
  516. 0,0,0,0
  517. };
  518. #endregion HandTracking
  519. #region Deflection
  520. #endregion Deflection
  521. #region PointCloud & Map
  522. #endregion PointCloud & Map
  523. #region FishEye Data
  524. #endregion FishEye Data
  525. #region Optics Calibration
  526. #endregion Optics Calibration
  527. #region EyeTracking
  528. #endregion EyeTracking
  529. #region USBDisconnect
  530. #endregion
  531. #region luncher
  532. #endregion
  533. #region Device
  534. public override ulong GSXR_Get_SupportSlamMode() {
  535. return 6;
  536. }
  537. public override XRType GSXR_Get_XRType() { return XRType.VR; }
  538. public override string GSXR_Get_DeviceName() { return "Window AR"; }
  539. public override float GSXR_Get_ControllerVersion() { return 1.6f; }
  540. public override string GSXR_Get_InternalVersion() { return "XR_xxxxxx"; }
  541. public override string SN => "000";
  542. public override string RELEASE_VERSION => "0.0.0";
  543. public override int BatteryLevel => 60;
  544. #endregion
  545. }