How do you limit how far the mouse can turn/rotate an object?

i havent had much time to work on side projects lately, but im still thinking about this.