Regular API function

simSetObjectQuaternion / sim.setObjectQuaternion

Description Sets the quaternion (x,y,z,w) of an object. Dynamically simulated objects, together with their hierarchy tree, will be dynamically reset (this however does not apply to static shapes). See also the other matrix/transformation functions.
C/C++
synopsis
simInt simSetObjectQuaternion(simInt objectHandle,simInt relativeToObjectHandle,const simFloat* quaternion)
C/C++
parameters
objectHandle: handle of the object. Combine with sim.handleflag_wxyzquaternion to provide the quaternion as (w,x,y,z) order instead of (x,y,z,w) order. Can also be combined with sim.handleflag_reljointbaseframe (see next argument)
relativeToObjectHandle: indicates relative to which reference frame the orientation is specified. Specify -1 to set the absolute orientation, sim_handle_parent to set the orientation relative to the object's parent, or an object handle relative to whose reference frame the orientation is specified. If this handle is the handle of a joint, then the quaternion is applied relative to the joint's moving frame (unless objectHandle is combined with sim.handleflag_reljointbaseframe, in which case the quaternion is applied relative to the joint's base frame).
quaternion: the quaternion (x,y,z,w)
C/C++
return value
-1 if operation was not successful
Lua synopsis sim.setObjectQuaternion(int objectHandle,int relativeToObjectHandle,float[4] quaternion)
Lua parameters
Similar to the C-function counterpart
Lua return values
Python synopsis sim.setObjectQuaternion(int objectHandle,int relativeToObjectHandle,list quaternion)