I have a quaternion representing the orientantion of an object (yellow box and sphere). I would like to know if it is possible to split that quaternion into other quaternions that give us the rotation of each local axis (X, Y and Z).
What I have been doing until now is getting the Euler representation and work with it, but it is not the correct solution for my particular case:
Given two points (blue boxes), I want to limit the orientation of my object so that it can't point out of the grey plane, even if my quaternion looks out of that plane.
I want to split (decompose) the quaternion, because when my object reachs the limit of the plane (for instance, the right), I want to make it stay there (in that component), and then rotate my object in the vertical component, using one of the new splitted quaternion.
I am working with Unity.
I hope it is understandable my problem :)