// Start is called before the first frame update
 void Start()
 {
     if (!MLWorldPlanes.Start().IsOk)
     {
         Debug.LogWarning("MLPlanes failed to start correctly");
     }
 }
示例#2
0
        //Init:
        private void Start()
        {
            Initialize();

            //start planes:
            MLWorldPlanes.Start();
            GetPlanes();
        }
示例#3
0
 /// <summary>
 /// Initializes variables and makes sure they started correctly
 /// </summary>
 void OnEnable()
 {
     if (!MLWorldPlanes.Start())
     {
         Debug.LogError("Error Planes starting MLWorldPlanes, disabling script.");
         enabled = false;
         return;
     }
 }
示例#4
0
    void Start()
    {
        // Start Planes.
        MLWorldPlanes.Start();

        // The max number of planes returned by the query.
        _queryParams.MaxResults = 1;

        // Set the Planes Request to repeat every 5 secs.
        InvokeRepeating("RequestPlanes", 1f, 5f);
    }
示例#5
0
        /// <summary>
        /// Initializes variables and makes sure they started correctly
        /// </summary>
        void OnEnable()
        {
            MLResult result = MLWorldPlanes.Start();

            if (!result.IsOk)
            {
                Debug.LogError("Error Planes starting MLWorldPlanes, disabling script.");
                enabled = false;
                return;
            }
        }
示例#6
0
 private void Start()
 {
     MLWorldPlanes.Start();
     Debug.Log("Started MLWorldPlanes");
     //requestPlanes();
     //List<float> distancesNonFloorPlanes = new List<float>();
     //Debug.Log("Above floors list has " + _aboveFloorList.Count + " planes");
     //for(int i = 0; i < _aboveFloorList.Count; i++)
     //{
     //	distancesNonFloorPlanes.Add(Vector3.Distance(Camera.main.transform.position, _aboveFloorList[i].transform.position));
     //}
     //int minValueIndex = distancesNonFloorPlanes.IndexOf(distancesNonFloorPlanes.Min());
     //playerInstantiationPosition = _aboveFloorList[minValueIndex].transform.position;
 }
    void Awake()
    {
        MLResult result = MLWorldPlanes.Start();

        if (!result.IsOk)
        {
            Debug.LogError("Error Planes starting MLWorldPlanes, disabling script.");
            enabled = false;
            return;
        }
        var queryParams = new MLWorldPlanesQueryParams();
        var queryFlags  = MLWorldPlanesQueryFlags.Horizontal;

        queryParams.Flags          = queryFlags;
        queryParams.MaxResults     = MAX_RESULTS;
        queryParams.BoundsCenter   = BBoxTransform.position;
        queryParams.BoundsRotation = BBoxTransform.rotation;
        queryParams.BoundsExtents  = BBoxExtents;
        MLWorldPlanes.GetPlanes(queryParams, HandleOnReceivedPlanes);
    }
示例#8
0
    void Awake()
    {
        MLResult hResult  = MLHands.Start();
        MLResult iResult  = MLInput.Start();
        MLResult pResult  = MLWorldPlanes.Start();
        MLResult wrResult = MLWorldRays.Start();

        if (
            !hResult.IsOk ||
            !iResult.IsOk ||
            !pResult.IsOk ||
            !wrResult.IsOk
            )
        {
            Debug.LogError("Error starting ML APIs, disabling script.");
            enabled = false;
            return;
        }

        // HANDS
        var enabledPoses = new MLHandKeyPose[] {
            MLHandKeyPose.Fist,
        };

        MLHands.KeyPoseManager.EnableKeyPoses(enabledPoses, true);

        // INPUT
        _iController = MLInput.GetController(MLInput.Hand.Left);

        // WORLD PLANES
        var queryParams = new MLWorldPlanesQueryParams();
        var queryFlags  = MLWorldPlanesQueryFlags.Horizontal | MLWorldPlanesQueryFlags.SemanticFloor;

        queryParams.Flags      = queryFlags;
        queryParams.MaxResults = WP_MAX_PLANES;
        MLWorldPlanes.GetPlanes(queryParams, HandleOnReceivedPlanes);

        // WORLD RAYS
        _wrBaseHeight      = transform.position.y;
        _wrLastCentimeters = (int)Math.Truncate(_wrBaseHeight * 100);
    }
 // Use this for initialization
 void Start()
 {
     MLWorldPlanes.Start();
     PlanePrefab.SetActive(false);
 }
示例#10
0
 // Use this for initialization
 void Start()
 {
     MLWorldPlanes.Start();
 }
示例#11
0
 // Start is called before the first frame update
 void Start()
 {
     // Start Plane Extraction
     MLWorldPlanes.Start();
 }