/// <summary>
    ///   Displays the hand layer that can be on top or behind the virtual objects
    /// </summary>
    /// <param name="hand_info">Hand information provided by Manomotion Manager class</param>
    /// <param name="layer_hands">Reference to the meshrenderer of the hands</param>
    /// <param name="mano_manager">Reference to the Manomotion Manager class</param>
    void ShowLayering(HandInfoUnity hand_info, MeshRenderer layer_hands, ManomotionManager mano_manager)
    {
        layer_hands.gameObject.SetActive(_show_hand_layer);
        layering_object.SetActive(_show_hand_layer);
        if (_show_hand_layer)
        {
            ManoUtils.Instance.OrientMeshRenderer(layer_hands);

            //Assign the texture
            layer_hands.material.mainTexture = hand_info.cut_rgb;

            //Move forward according to depth
            layer_hands.transform.localPosition = Vector3.forward * hand_info.hand_info.tracking_info.relative_depth;

            //Adjust the size in order to fit the screen
            mano_utils.AjustBorders(layer_hands, ManomotionManager.Instance.Manomotion_Session);
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    ///   Displays the hand layer that can be on top or behind the virtual objects
    /// </summary>
    /// <param name="hand_info">Hand information provided by Manomotion Manager class</param>
    /// <param name="layer_hands">Reference to the meshrenderer of the hands</param>
    /// <param name="mano_manager">Reference to the Manomotion Manager class</param>
    void ShowLayering(HandInfoUnity hand_info, MeshRenderer layer_hands, ManomotionManager mano_manager)
    {
        layer_hands.enabled = _show_hand_layer;
        layering_sphere.SetActive(_show_hand_layer);
        if (_show_hand_layer)
        {
            // Fix rotation based on Orientation
            switch (ManomotionManager.Instance.Manomotion_Session.orientation)
            {
            case SupportedOrientation.PORTRAIT:
                layer_hands.transform.rotation = Quaternion.Euler(0, 0, -90);
                break;

            case SupportedOrientation.PORTRAIT_INVERTED:
                layer_hands.transform.rotation = Quaternion.Euler(0, 0, 90);
                break;

            case SupportedOrientation.LANDSCAPE_LEFT:
                layer_hands.transform.rotation = Quaternion.Euler(0, 0, 0);
                break;

            case SupportedOrientation.LANDSCAPE_RIGHT:
                layer_hands.transform.rotation = Quaternion.Euler(0, 0, 180);
                break;

            default:
                break;
            }

            //Assign the texture
            layer_hands.material.mainTexture = hand_info.cut_rgb;

            //Move forward according to depth
            layer_hands.transform.localPosition = Vector3.forward * hand_info.hand_info.tracking_info.relative_depth;

            //Adjust the size in order to fit the screen
            mano_utils.AjustBorders(layer_hands, cam, false);
        }
    }