I tried following but it looks like it's turning along global axis instead of local axis and actually a strange value behaviour... higher values decreasing and lower values increasing turning speed. Can't actually stop rotation of physics objects. Makes me many headaches
I may don't understand the values and function of SetObject3DPhysicsangularVelocity correctly... Hope somebody could help out with a better way of controlling rotation of a physics object.... Thanks in advance!
function addrotationtoobject(obj,_vecx#,_vecy#,_vecz#)
xspeed# = GetObject3DPhysicsAngularVelocityX(obj)
yspeed# = GetObject3DPhysicsAngularVelocityY(obj)
zspeed# = GetObject3DPhysicsAngularVelocityZ(obj)
curposx# = GetObjectX(obj)
curposy# = GetObjectY(obj)
curposz# = GetObjectZ(obj)
currotx# = GetObjectAngleX(obj)
curroty# = GetObjectAngleY(obj)
currotz# = GetObjectAngleZ(obj)
forceobj = CreateObjectBox(1.0,1.0,1.0)
SetObjectPosition(forceobj,curposx#,curposy#,curposz#)
SetObjectRotation(forceobj,currotx#,curroty#,currotz#)
RotateObjectGlobalX(forceobj,xspeed#)
RotateObjectGlobalY(forceobj,yspeed#)
RotateObjectGlobalZ(forceobj,zspeed#)
RotateObjectLocalX(forceobj,_vecx#)
RotateObjectLocalY(forceobj,_vecy#)
RotateObjectLocalZ(forceobj,_vecz#)
newrotx# = GetObjectAngleX(forceobj)
newroty# = GetObjectAngleY(forceobj)
newrotz# = GetObjectAngleZ(forceobj)
deleteobject(forceobj)
deltax# = (newrotx# - currotx#)
deltay# = (newroty# - curroty#)
deltaz# = (newrotz# - currotz#)
curspeedvector = CreateVector3(deltax#,deltay#,deltaz#)
totalspeed# = GetVector3Length(curspeedvector)
SetObject3DPhysicsangularVelocity(obj,curspeedvector,totalspeed#)
endfunction