GetSurportedFeatures.cs 2.7 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 UnityEngine;
  10. namespace NRKernal.NRExamples
  11. {
  12. public class GetSurportedFeatures : MonoBehaviour
  13. {
  14. void Start()
  15. {
  16. var deviceType = NRDevice.Subsystem.GetDeviceType();
  17. bool tracking_six_dof = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_TRACKING_6DOF);
  18. bool tracking_three_dof = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_TRACKING_3DOF);
  19. bool tracking_plane_horizontal = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_TRACKING_FINDING_HORIZONTAL_PLANE);
  20. bool tracking_plane_vertical = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_TRACKING_FINDING_VERTICAL_PLANE);
  21. bool tracking_imagetracking = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_TRACKING_FINDING_MARKER);
  22. bool controller_three_dof = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_CONTROLLER_3DOF);
  23. bool controller_six_dof = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_CONTROLLER_6DOF);
  24. bool glasses_wearing_status = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_WEARING_STATUS_OF_GLASSES);
  25. bool handtracking = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_HANDTRACKING);
  26. bool rgbcamera = NRDevice.Subsystem.IsFeatureSupported(NRSupportedFeature.NR_FEATURE_RGB_CAMERA);
  27. NRDebugger.Info("deviceType:{10}, tracking_six_dof:{0} tracking_three_dof:{1} tracking_plane_horizontal:{2} tracking_plane_vertical:{3}" +
  28. "tracking_imagetracking:{4} controller_three_dof:{5} controller_six_dof:{6} glasses_wearing_status:{7} handtracking:{8} rgbcamera:{9}",
  29. tracking_six_dof, tracking_three_dof, tracking_plane_horizontal, tracking_plane_vertical, tracking_imagetracking, controller_three_dof,
  30. controller_six_dof, glasses_wearing_status, handtracking, rgbcamera, deviceType);
  31. }
  32. }
  33. }