TBOrbit.Apply C# (CSharp) Method

Apply() public method

public Apply ( ) : void
return void
    void Apply()
    {
        if( smoothMotion )
        {
            distance = Mathf.Lerp( distance, IdealDistance, Time.deltaTime * smoothZoomSpeed );
            yaw = Mathf.Lerp( yaw, IdealYaw, Time.deltaTime * smoothOrbitSpeed );
            pitch = Mathf.LerpAngle( pitch, IdealPitch, Time.deltaTime * smoothOrbitSpeed );
        }
        else
        {
            distance = IdealDistance;
            yaw = IdealYaw;
            pitch = IdealPitch;
        }

        if( smoothPanning )
            panOffset = Vector3.Lerp( panOffset, idealPanOffset, Time.deltaTime * smoothPanningSpeed );
        else
            panOffset = idealPanOffset;

        transform.rotation = Quaternion.Euler( pitch, yaw, 0 );
        transform.position = ( target.position + panOffset ) - distance * transform.forward;
    }