예제 #1
0
    /// <summary>
    /// Adjustcorrections the ratio.
    /// </summary>
    void AdjustcorrectionRatio()
    {
        if (Show_background_layer)
        {
            // orientation
            switch (ManomotionManager.Instance.Manomotion_Session.orientation)
            {
            case SupportedOrientation.PORTRAIT:
                _layer_background.transform.rotation = Quaternion.Euler(0, 0, -90);
                break;

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

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

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

            default:
                break;
            }

            //adjust borders
            mano_utils.AjustBorders(_layer_background, cam, true);
        }
    }
    /// <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);
        }
    }