Why wouldn't your sensor be facing forwards? If you have it on some panning mechanism, say, controlled by a servo, which is probably the easiest way to do pan it, you would probably set delays in the program after telling the servo to go to a specific angle to ensure that it is at that angle when you take a measurement. In this case you are making the safe assumption that nothing will physically prevent the panning servo from pointing the IR rangefinder in the direction you want (given a reasonable amount of time).