Hi - Just a little background so you can understand what I am doing.
I am creating a game that has several cubes fall to the floor. All the cubes have physical bodies attached to them. As the cubes fall they may be rotated in either direction due to a couple of moving obstacles. Eventually each of the cubes come to rest on the floor. Once they have come to rest (that brings up another question - how do I know when a physical object has come to rest?). Here is what I need …
I need to get the relative (user’s point of view) rotation of a cube when I “click” on it (I got the touch event). For example:
If a cube rotates 90 degrees CW (clock-wise) then I should get 90 degrees
If a cube rotates 180 degrees CW (clock-wise) then I should get 180 degrees
If a cube rotates 270 degrees CW (clock-wise) then I should get 270 degrees
If a cube rotates 360 degrees CW (clock-wise) then I should get 0 degrees!!
If a cube rotates -90 degrees CCW (counter clock-wise) then I should get -90 degrees!!
If a cube rotates -360 degrees CCW (counter clock-wise) then I should get 0 degrees!!
If a cube rotates 540 degrees CW (clock-wise) then I should get 180 degrees!!
See, the angle of rotation should be relative to the viewers point of view. I can handle the rotation of the device by reversing the rotation value.
Thank you in advance - Looking forward to hearing your solutions