Ejemplo n.º 1
0
 private void Start()
 {
     #if PLATFORM_LUMIN
     MLResult result = MLHeadTracking.Start();
     if (result.IsOk)
     {
         MLHeadTracking.RegisterOnHeadTrackingMapEvent(HandleOnHeadTrackingMapEvent);
     }
     else
     {
         Debug.LogError("PlanesVisualizer could not register to head tracking events because MLHeadTracking could not be started.");
     }
     #endif
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Start bounds based on _bounded state.
 /// </summary>
 void Start()
 {
     #if PLATFORM_LUMIN
     MLResult result = MLHeadTracking.Start();
     if (result.IsOk)
     {
         MLHeadTracking.RegisterOnHeadTrackingMapEvent(OnHeadTrackingMapEvent);
     }
     else
     {
         Debug.LogError("PlanesExample could not register to head tracking events because MLHeadTracking could not be started.");
     }
     #endif
     UpdateBounds();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Set correct render mode for meshing and update meshing settings.
        /// </summary>
        void Start()
        {
            #if PLATFORM_LUMIN
            // Assure that if the 'WorldReconstruction' privilege is missing, then it is logged for all users.
            MLResult result = MLPrivilegesStarterKit.Start();
            if (result.IsOk)
            {
                result = MLPrivilegesStarterKit.CheckPrivilege(MLPrivileges.Id.WorldReconstruction);
                if (result.Result != MLResult.Code.PrivilegeGranted)
                {
                    Debug.LogErrorFormat("Error: MeshingExample failed to create Mesh Subsystem due to missing 'WorldReconstruction' privilege. Please add to manifest. Disabling script.");
                    enabled = false;
                    return;
                }
                MLPrivilegesStarterKit.Stop();
            }
            else
            {
                Debug.LogErrorFormat("Error: MeshingExample failed starting MLPrivileges, disabling script. Reason: {0}", result);
                enabled = false;
                return;
            }

            result = MLHeadTracking.Start();
            if (result.IsOk)
            {
                MLHeadTracking.RegisterOnHeadTrackingMapEvent(OnHeadTrackingMapEvent);
            }
            else
            {
                Debug.LogError("MeshingExample could not register to head tracking events because MLHeadTracking could not be started.");
            }
            #endif

            _meshingVisualizer.SetRenderers(_renderMode);

            _mlSpatialMapper.gameObject.transform.position   = _camera.gameObject.transform.position;
            _mlSpatialMapper.gameObject.transform.localScale = _bounded ? _boundedExtentsSize : _boundlessExtentsSize;

            _visualBounds.SetActive(_bounded);
        }