Regular API function

simSetObjectOrientation / sim.setObjectOrientation

Description Sets the orientation (Euler angles) of an object. Dynamically simulated objects will implicitely be reset before the command is applied (i.e. similar to calling sim.resetDynamicObject just before). See also the other matrix/transformation functions.
C synopsis simInt simSetObjectOrientation(simInt objectHandle,simInt relativeToObjectHandle,const simFloat* eulerAngles)
C parameters
objectHandle: handle of the object. Can 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 orientation is applied relative to the joint's moving frame (unless objectHandle is combined with sim.handleflag_reljointbaseframe, in which case the orientation is applied relative to the joint's base frame).
eulerAngles: Euler angles (alpha, beta and gamma)
C return value
-1 if operation was not successful
Lua synopsis sim.setObjectOrientation(int objectHandle,int relativeToObjectHandle,table[3] eulerAngles)
Lua parameters
Similar to the C-function counterpart
Lua return values
Remote API equiv.
B0-based remote API: simxSetObjectOrientation
Legacy remote API: simxSetObjectOrientation