CameraResetController.cs 1.3 KB

12345678910111213141516171819202122232425262728293031
  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 CameraResetController : MonoBehaviour
  13. {
  14. void Start()
  15. {
  16. NRInput.AddClickListener(ControllerHandEnum.Right, ControllerButton.APP, () =>
  17. {
  18. var poseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
  19. poseTracker.ResetWorldMatrix(true);
  20. });
  21. }
  22. public void ResetCameraToOrigin(bool resetPitch)
  23. {
  24. var poseTracker = NRSessionManager.Instance.NRHMDPoseTracker;
  25. poseTracker.ResetWorldMatrix(resetPitch);
  26. }
  27. }
  28. }