Ejemplo n.º 1
0
 /// <summary>
 /// Initializes component.
 /// </summary>
 virtual protected void OnEnable()
 {
     _isReady = true;
     if (!MLWorldRays.Start())
     {
         Debug.LogError("Error BaseRaycast starting MLWorldRays, disabling script.");
         enabled = false;
         return;
     }
 }
Ejemplo n.º 2
0
    void Awake()
    {
        MLResult result = MLWorldRays.Start();

        if (!result.IsOk)
        {
            Debug.LogError("Error BaseRaycast starting MLWorldRays, disabling script.");
            enabled = false;
            return;
        }
        var raycastParams = new MLWorldRays.QueryParams();

        raycastParams.Position  = POSITION;
        raycastParams.Direction = DIRECTION;
        MLWorldRays.GetWorldRays(raycastParams, HandleOnReceiveRaycast);
    }
Ejemplo n.º 3
0
    // Start is called before the first frame update

    void Start()
    {
        MLWorldRays.Start();
        obj = Instantiate(prefab);
        obj.transform.localScale = new Vector3(0.02f, 0.02f, 0.02f);
        //obj.SetActive(false);

        /*
         * MLResult result = MLHands.Start();
         * if (!result.IsOk)
         * {
         *  Debug.LogErrorFormat("Error: HandTrackingVisualizer failed starting MLHands, disabling script. Reason: {0}", result);
         *  enabled = false;
         *  return;
         * }
         */
    }
Ejemplo n.º 4
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);
    }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     MLWorldRays.Start();
 }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     // Start accessing the ML World Ray API.
     MLWorldRays.Start();
 }