ChangeModeController.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /****************************************************************************
  2. * Copyright 2019 Nreal Techonology Limited. All rights reserved.
  3. *
  4. * This file is part of NRSDK.
  5. *
  6. * https://www.nreal.ai/
  7. *
  8. *****************************************************************************/
  9. using UnityEngine;
  10. namespace NRKernal.NRExamples
  11. {
  12. public class ChangeModeController : MonoBehaviour
  13. {
  14. public void ChangeTo6Dof()
  15. {
  16. var hmdPoseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
  17. NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo6Dof((result) =>
  18. {
  19. NRDebugger.Info("[ChangeModeController] ChangeTo6Dof result:" + result.success);
  20. });
  21. }
  22. public void ChangeTo3Dof()
  23. {
  24. var hmdPoseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
  25. NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo3Dof((result) =>
  26. {
  27. NRDebugger.Info("[ChangeModeController] ChangeTo3Dof result:" + result.success);
  28. });
  29. }
  30. public void ChangeTo0Dof()
  31. {
  32. var hmdPoseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
  33. NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo0Dof((result) =>
  34. {
  35. NRDebugger.Info("[ChangeModeController] ChangeTo0Dof result:" + result.success);
  36. });
  37. }
  38. public void ChangeTo0DofStable()
  39. {
  40. var hmdPoseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
  41. NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo0DofStable((result) =>
  42. {
  43. NRDebugger.Info("[ChangeModeController] ChangeTo0DofStable result:" + result.success);
  44. });
  45. }
  46. }
  47. }