void FixedUpdate()
    {
        //get the device associated with that tracked object (which is how you access buttons and stuff)
        SteamVR_Controller.Device device = SteamVR_Controller.Input((int)trackedObj.index);

        //get the velocity
        //velocity = device.transform.rot.eulerAngles;
        //print(comfortZoomVignette.intensity);
        //print(q);
        if (Controller.GetPress(SteamVR_Controller.ButtonMask.Trigger) == false)
        {
            //graph.transform.rotation = Quaternion.Lerp(graph.transform.rotation, rotateGraphTo, 0.01f);
            pulling = false;
            if (mini != null)
            {
                if (nodeParent != null)
                {
                    mini.transform.parent = nodeParent;
                }
                mini.setMoving(false);
            }
        }
        StudyController();
        // Laser code
        if (laser != null && studyState == 2)
        {
            circle.transform.position = laserTransform.position + laserTransform.forward * (laserDist * 2);
            circle.transform.LookAt(Camera.main.transform);
            laserTransform.position   = trackedObj.transform.position;
            laserTransform.rotation   = trackedObj.transform.rotation;
            laserTransform.localScale = new Vector3(laserTransform.localScale.x, laserTransform.localScale.y,
                                                    laserDist);
            if (Controller.GetHairTriggerDown())
            {
                Camera_System camera_sys       = Camera.main.GetComponent <Camera_System>();
                Vector3       teleportPosition = transform.position + transform.forward * (laserDist * 2);
                camera_sys.FadeOutIn(teleportPosition);
                camera_sys.setLaserPointer(this);
            }
            if (q.y > 0.4f)
            {
                laserDist += Time.deltaTime * 0.5f;
            }

            if (q.y < -0.4f && laserDist > 0.1f)
            {
                laserDist -= Time.deltaTime * 0.5f;
            }
        }
        if (Controller.GetPress(SteamVR_Controller.ButtonMask.Trigger) && save_button != null)
        {
            save_button.pushButton();
        }
        // Creates a path marker
        if (Controller.GetPressDown(SteamVR_Controller.ButtonMask.Grip))
        {
            Instantiate(pathMarker, transform.position + new Vector3(0, 0.01f, 0), pathMarker.transform.rotation);
        }

        if (Controller.GetPress(SteamVR_Controller.ButtonMask.Trigger) && node != null && Dual_Controller_Behaviour.zoomGesture == false && save_button == null)
        {
            if (userStudyRunning == false)
            {
                pulling = true;
            }
            if (node.transform.tag == "NavigationCamera")
            {
                pulling = true;
            }
            if (node.transform.tag == "pathMarker")
            {
                pulling = true;
            }

            Vector3 v_rot = Controller.angularVelocity;
            Vector3 v_pos = Controller.velocity;


            if (node.transform.name == "filter_cube")
            {
                Vector3 new_rot = new Vector3(0, v_rot.y, 0);
                node.transform.rotation *= Quaternion.Euler(new_rot);
                node.transform.position  = transform.position + new Vector3(0, 0.1f, 0);
                //node.transform.rotation = transform.rotation;
            }
            if (node.transform.tag == "NavigationCamera")
            {
                //Power_Button_Behaviour p = node.transform.root.GetComponentInChildren<Power_Button_Behaviour>();
                mini = node.transform.GetComponent <Miniature_Camera_Behaviour>();
                mini.setMoving(true);
                mini.setCone(transform);
                //graph.transform.rotation = transform.rotation;
                print("mini = " + mini);
                Vector3 new_rot = new Vector3(0, 0, v_rot.z);
                //node.transform.localRotation *= Quaternion.Euler(new_rot);

                node.transform.parent = transform;
                //Camera.main.transform.parent.localPosition += Controller.velocity * 0.1f;
            }
            else
            {
                if (mini != null)
                {
                    mini.setMoving(false);
                    //mini = null;
                }
            }
            if (node.transform.tag == "Lever")
            {
                lev = node.GetComponent <Lever_Behaviour>();
                if (lev.isHorizontial)
                {
                    if (v_pos.x > 0.1f)
                    {
                        lev.movetoPos2();
                    }
                    if (v_pos.x < -0.1f)
                    {
                        lev.movetoPos1();
                    }
                }
                if (lev.isVertical)
                {
                    if (v_pos.y > 0.1f)
                    {
                        lev.movetoPos1();
                    }
                    if (v_pos.y < -0.1f)
                    {
                        lev.movetoPos2();
                    }
                }
            }
            if (node.transform.tag == "cluster" && !userStudyRunning || node.transform.tag == "Node" && !userStudyRunning)
            {
                if (userStudyRunning == false)
                {
                    node.transform.position = transform.position + new Vector3(0, 0.01f, 0);
                    if (Controller.velocity.magnitude > 1.5f && node.transform.tag == "Node")
                    {
                        //node.transform.GetComponent<Rigidbody>().useGravity = true;
                        node.transform.GetComponent <Rigidbody>().velocity = Controller.velocity;
                        node = null;
                    }
                }
            }
            if (node.transform.tag == "Untagged" || node.transform.tag == "SaveBox" && save_button == null ||
                node.transform.tag == "pathMarker")
            {
                Destroy(node.gameObject);
                node = null;
            }
        }
        else
        {
            if (lev != null)
            {
                lev.movetoStartPos();
                lev = null;
            }
        }

        if (!pulling && node != null)
        {
            t -= Time.deltaTime;
            if (t <= 0)
            {
                node = null;
                t    = 0.5f;
            }
        }
        if (documentText)
        {
            if (Controller.velocity.y > 0.4f && doc_time <= 0)
            {
                doc_move = 1;
                doc_time = 0.5f;
            }
            if (Controller.velocity.y < -0.4f && doc_time <= 0)
            {
                doc_move = -1;
                doc_time = 0.5f;
            }
        }
        if (doc_time > -0.01f && documentText != null)
        {
            documentText.anchoredPosition += new Vector2(0, 0.05f * doc_move);
            doc_time -= Time.deltaTime;
        }

        if (laser_t >= 0)
        {
            laser_t -= Time.deltaTime;
        }

        if (Controller.GetPress(SteamVR_Controller.ButtonMask.Touchpad) && q.y > -0.7f)
        {
            touchPadDown = true;
            RaycastHit hit;
            laser.SetActive(true);

            if (target != null)
            {
                target.enabled = true;
            }

            if (Physics.Raycast(trackedObj.transform.position, transform.forward, out hit, 100))
            {
                hitPoint = hit.point;
                ShowLaser(hit);
            }
        }
        else
        {
            touchPadDown = false;
        }
    }
 private void Awake()
 {
     miniCam = FindObjectOfType <Miniature_Camera_Behaviour>();
 }
 // Use this for initialization
 void Start()
 {
     wim = FindObjectOfType <World_Miniature_Graph>();
     cam = FindObjectOfType <Miniature_Camera_Behaviour>();
 }