//========================================================

    void Start()
    {
        //--------Ravi----------/
        script = GetComponent <TBDragOrbit>();
        //---------------------/


        if (!panningPlane)
        {
            panningPlane = this.transform;
        }

        Vector3 angles = transform.eulerAngles;

        distance = IdealDistance = initialDistance;
        yaw      = IdealYaw = angles.y;
        pitch    = IdealPitch = angles.x;

        // Make the rigid body not change rotation
        if (GetComponent <Rigidbody>())
        {
            GetComponent <Rigidbody>().freezeRotation = true;
        }

        Apply();
    }
Exemple #2
0
    void Start()
    {
        Debug.Log("Getting Camera FOV");

        //-------Takes the camera FOV and calculates derived values to later use in camera distance calculation-----
        cameraFOV           = animationCamera.GetComponent <Camera>().fieldOfView;
        cameraFOVBasedValue = Mathf.Tan(Mathf.Deg2Rad * cameraFOV / 2f);
        originalRotation    = animationCamera.transform.rotation.eulerAngles;

        TBDragOrbitScript = animationCamera.GetComponent <TBDragOrbit>();

        //-------------- Saving camera position ---------------
        StoreOriginalPosition(animationCamera.transform.position);

        //-------------- Saving camera rotation ---------------
        StoreOriginalRotation();
    }
    //========================================================
    void Start()
    {
        //--------Ravi----------/
        script = GetComponent<TBDragOrbit>();
        //---------------------/

        if( !panningPlane )
            panningPlane = this.transform;

        Vector3 angles = transform.eulerAngles;

        distance = IdealDistance = initialDistance;
        yaw = IdealYaw  = angles.y;
        pitch = IdealPitch = angles.x;

        // Make the rigid body not change rotation
        if( GetComponent<Rigidbody>() )
            GetComponent<Rigidbody>().freezeRotation = true;

        Apply();
    }
    void Start()
    {
        Debug.Log("Getting Camera FOV");

        //-------Takes the camera FOV and calculates derived values to later use in camera distance calculation-----
        cameraFOV = animationCamera.GetComponent<Camera>().fieldOfView;
        cameraFOVBasedValue = Mathf.Tan(Mathf.Deg2Rad * cameraFOV / 2f);
        originalRotation = animationCamera.transform.rotation.eulerAngles;

        TBDragOrbitScript = animationCamera.GetComponent<TBDragOrbit>();

        //-------------- Saving camera position ---------------
        StoreOriginalPosition(animationCamera.transform.position);

        //-------------- Saving camera rotation ---------------
        StoreOriginalRotation();
    }