   Quaternion - restricting movement.
  Hi,I'm using the Virtual Trackball class that comes with the SDK to express the orientation of an object on screen (a graph).  I'd like to restrict the movement of this object, preventing the user from tilting it by more than, say, 45 degrees on any axis.I can't work out how to do it.  The trackball uses a D3DXQUATERNION internally of course.  Do I just need to break the quat into x, y, z angles and test those?  There's a method to compose a quat from x, y, z with D3D, but there isn't one to break it down into them.Thanks for any assistance you can give me.   
  The best way would probably to keep track of the angles separately from the quaternion. So have your yaw, pitch and roll as separate floats, adjust them however you want, test them to make sure they don't go over the value you want and then create a quaternion with them.The angle floats have to be retained in the object for use in the next frame of course. This is what I do for my camera anyway whose pitch I stop from going too far up or down.   