public void UpdateFreeCamera()
    {
        if (NrTSingleton <FormsManager> .Instance.IsMouseOverForm())
        {
            return;
        }
        if (CameraController.EnableControll && NkInputManager.GetButton("Fire2"))
        {
            this.UpdateEulerAngle(NkInputManager.GetAxis("Mouse X"), NkInputManager.GetAxis("Mouse Y"));
        }
        Vector3 vector = Vector3.zero;

        if (CameraController.EnableControll && NrTSingleton <UIManager> .Instance.FocusObject == null)
        {
            bool flag  = NkInputManager.GetKey(KeyCode.W) || NkInputManager.GetKey(KeyCode.Keypad8) || NkInputManager.GetKey(KeyCode.UpArrow);
            bool flag2 = NkInputManager.GetKey(KeyCode.S) || NkInputManager.GetKey(KeyCode.Keypad2) || NkInputManager.GetKey(KeyCode.DownArrow);
            bool flag3 = NkInputManager.GetKey(KeyCode.A) || NkInputManager.GetKey(KeyCode.Keypad4) || NkInputManager.GetKey(KeyCode.LeftArrow);
            bool flag4 = NkInputManager.GetKey(KeyCode.D) || NkInputManager.GetKey(KeyCode.Keypad6) || NkInputManager.GetKey(KeyCode.RightArrow);
            if (flag)
            {
                vector += new Vector3(0f, 0f, this.MoveSpeed);
            }
            if (flag2)
            {
                vector += new Vector3(0f, 0f, -this.MoveSpeed);
            }
            if (flag3)
            {
                vector += new Vector3(-this.MoveSpeed, 0f, 0f);
            }
            if (flag4)
            {
                vector += new Vector3(this.MoveSpeed, 0f, 0f);
            }
        }
        Quaternion rotation = this.QY * this.QX;
        Vector3    vector2  = rotation * new Vector3(0f, 0f, -this.distance);

        vector = this.QY * vector;
        this.SetMovePos(this.GetMovePos() + vector);
        vector2 += this.GetMovePos();
        if (!this.m_bMotionBlurCamera)
        {
            Vector3 pos = vector2;
            pos = NrTSingleton <NrTerrain> .Instance.GetWorldHeight(pos);

            if (vector2.y < pos.y)
            {
                vector2.y = pos.y + 1f;
            }
        }
        this.SetRotation(rotation);
        this.SetPosision(vector2);
        if (Camera.main)
        {
            Camera.main.fieldOfView = this.ffovMax;
        }
    }