SlamProviderSimulator.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 System;
  10. using System.Collections;
  11. using System.Collections.Generic;
  12. using UnityEngine;
  13. using NRKernal;
  14. /// <summary>
  15. /// Simple demo for external slam provider. Try to move host gameobject in unity editor.
  16. /// </summary>
  17. public class SlamProviderSimulator : MonoBehaviour, IExternSlamProvider
  18. {
  19. // Start is called before the first frame update
  20. void Start()
  21. {
  22. NRSessionManager.Instance.NRHMDPoseTracker.RegisterSlamProvider(this);
  23. }
  24. // Update is called once per frame
  25. void Update()
  26. {
  27. }
  28. public Pose GetHeadPoseAtTime(UInt64 timeStamp)
  29. {
  30. return new Pose(transform.position, transform.rotation);
  31. }
  32. }