Added bounds checking to force pointing direction to be within a specified range if needed.