I have Transform component storing it's rotation as Quaternion. Transform has set/getEulerAngles (rotation order oy, ox, oz). I want to rotate object in any direction but while testing I get jumping(glitch) objects stop rotating at specific angles.
Euler angles in problem frames:
1) oy 0 ox -90 oz 0 - previous frame.
2) oy 180 ox -90 oz 180 - next frame after incrementing angle of the object.
my increment looks like:
tr->setEulerAngles(tr->eulerAngles()+Vector3(5,0,0));//rotate around ox by 5 degrees
visually this rotations are equal, but when I get angles 2) from quaternion and increment them it starts rotating in oposite direction, next frame rotation is again as 1), so there is infinite loop at this rotation (some kind of black hole;-)). What can it be? Something wrong with math?