GetPlayerEyeHeight() public method

public GetPlayerEyeHeight ( float &eyeHeight ) : bool
eyeHeight float
return bool
Esempio n. 1
0
    // UpdateEyeHeightOffset
    void UpdateEyeHeightOffset()
    {
        // We will update neck position, since camera root and eye center should
        // be set differently.
        if (Input.GetKeyDown(KeyCode.Alpha5))
        {
            Vector3 neckPosition = Vector3.zero;
            CameraController.GetNeckPosition(ref neckPosition);
            neckPosition.y -= HeightIncrement;
            CameraController.SetNeckPosition(neckPosition);
        }
        else if (Input.GetKeyDown(KeyCode.Alpha6))
        {
            Vector3 neckPosition = Vector3.zero;;
            CameraController.GetNeckPosition(ref neckPosition);
            neckPosition.y += HeightIncrement;
            CameraController.SetNeckPosition(neckPosition);
        }

        if (ShowVRVars == true)       // limit gc
        {
            float eyeHeight = 0.0f;
            CameraController.GetPlayerEyeHeight(ref eyeHeight);

            strHeight = System.String.Format("Eye Height (m): {0:F3}", eyeHeight);
        }
    }