Camera Rotation Question

I have a camera system set up in a way that requires it’s axis to change (specifically, the camera’s “up” vector points directly away from the scene origin at all times), but the camera needs to be able to “look around” (like a fps) as if the camera’s axis was in the default orientation. I’ve gotten this to work easily by making an empty gameobject that acts as the camera’s axis by using this simple line of code on it:

transform.rotation = Quaternion.FromToRotation (Vector3.up, transform.position);

Then I parent it to the camera and it can rotate properly like a fps camera. My question is how can I achieve the same effect without the empty parent object?

I think you are looking this line on a script attached to the camera:

transform.rotation = Quaternion.FromToRotation(transform.up, transform.position) * transform.rotation;