Using the latest version, and beta download, phy set rigid body rotation on the y axis does not work as expected.
X and Z work fine (although not in tandem, unless I'm using the command incorrectly).
However, along the Y axis, not only does it not rotate past -180 and +180, it doesn't always even rotate in the right direction!
sync on : sync rate 60
Make object Cube 1,5
phy start
phy set gravity 0,0,0
Phy Make rigid body dynamic box 1
KEY_UP=200 : KEY_DOWN=208 : KEY_LEFT=203 : KEY_RIGHT=205 : KEY_RIGHTCONTROL=157 : KEY_NUMZERO=82 : KEY_SPACE=57
Do
if keystate(KEY_UP)=1 Then phy set rigid body rotation 1, wrapvalue(object angle x(1)+5), object angle y(1), object angle z(1)
if keystate(KEY_DOWN)=1 Then phy set rigid body rotation 1, wrapvalue(object angle x(1)-5), object angle y(1), object angle z(1)
if keystate(KEY_LEFT)=1 Then phy set rigid body rotation 1, object angle x(1), wrapvalue(object angle y(1)-5), object angle z(1)
if keystate(KEY_RIGHT)=1 Then phy set rigid body rotation 1, object angle x(1), wrapvalue(object angle y(1)+5), object angle z(1)
if keystate(KEY_RIGHTCONTROL)=1 Then phy set rigid body rotation 1, object angle x(1), object angle y(1), wrapvalue(object angle z(1)+5)
if keystate(KEY_NUMZERO)=1 Then phy set rigid body rotation 1, object angle x(1), object angle y(1), wrapvalue(object angle z(1)-5)
if keystate(KEY_SPACE)=1 then phy set rigid body rotation 1,0,0,0
text 0,0,"X = "+str$(object angle x(1))
text 0,20,"Y = "+str$(object angle y(1))
text 0,40,"Z = "+str$(object angle z(1))
phy update
sync
Loop
EDIT:
So, the object not rotating along multiple dimensions at the same time is fixed when its one call over the multiple calls details above - and added a comparative object too.
Updated code to reflect this is:
sync on : sync rate 60
Make object Cube 1,5
Make object Cube 2,5
position object 1,-5,0,0
position object 2,5,0,0
position camera 0,0,-20
point camera 0,0,0
phy start
phy set gravity 0,0,0
Phy Make rigid body dynamic box 1
KEY_UP=200 : KEY_DOWN=208 : KEY_LEFT=203 : KEY_RIGHT=205 : KEY_RIGHTCONTROL=157 : KEY_NUMZERO=82 : KEY_SPACE=57
Do
xshift = (keystate(KEY_UP)-keystate(KEY_DOWN))*5
yshift = (keystate(KEY_LEFT)-keystate(KEY_RIGHT))*5
zshift = (keystate(KEY_RIGHTCONTROL)-keystate(KEY_NUMZERO))*5
phy set rigid body rotation 1,wrapvalue(object angle x(1)+xshift),wrapvalue(object angle y(1)+yshift),wrapvalue(object angle z(1)+zshift)
rotate object 2,wrapvalue(object angle x(2)+xshift),wrapvalue(object angle y(2)+yshift),wrapvalue(object angle z(2)+zshift)
if keystate(KEY_SPACE)=1
phy set rigid body rotation 1,0,0,0
rotate object 2,0,0,0
endif
if (object angle x(1)<0 OR object angle x(1)<>object angle x(1)) : ink rgb(255,0,0),0 : else : ink rgb(255,255,255),0 : endif
text object screen x(1)-30,100,"X = "+str$(object angle x(1))
if (object angle y(1)<0 OR object angle y(1)<>object angle y(1)) : ink rgb(255,0,0),0 : else : ink rgb(255,255,255),0 : endif
text object screen x(1)-30,120,"Y = "+str$(object angle y(1))
if (object angle z(1)<0 OR object angle z(1)<>object angle z(1)) : ink rgb(255,0,0),0 : else : ink rgb(255,255,255),0 : endif
text object screen x(1)-30,140,"Z = "+str$(object angle z(1))
ink rgb(255,255,255),0
text object screen x(2)-30,100,"X = "+str$(object angle x(2))
text object screen x(2)-30,120,"Y = "+str$(object angle y(2))
text object screen x(2)-30,140,"Z = "+str$(object angle z(2))
text 0,0,"UP/DOWN = xrotate"
text 0,20,"LEFT/RIGHT = yrotate"
text 0,40,"CTRL/NUM ZERO = zrotate"
text 0,60,"SPACE = reset"
phy update
sync
Loop
But even so, the object encounters gimbal lock that easily? On a *virtual* object, it won't under the same conditions.