Regular API function

simGetObjectOrientation / sim.getObjectOrientation

Description Retrieves the orientation (Euler angles) of an object. See also sim.getObjectQuaternion, sim.setObjectOrientation, sim.getObjectPosition, sim.getObjectMatrix and the other matrix/transformation functions.
C synopsis simInt simGetObjectOrientation(simInt objectHandle,simInt relativeToObjectHandle,simFloat* eulerAngles)
C parameters
objectHandle: handle of the object
relativeToObjectHandle: indicates relative to which reference frame we want the orientation. Specify -1 to retrieve the absolute orientation, sim_handle_parent to retrieve the orientation relative to the object's parent, or an object handle relative to whose reference frame you want the orientation.
eulerAngles: Euler angles (alpha, beta and gamma)
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis table_3 eulerAngles=sim.getObjectOrientation(number objectHandle,number relativeToObjectHandle)
Lua parameters
Same as C-function
Lua return values
eulerAngles: table of 3 values (Euler angles) or nil in case of an error
Remote API equiv.
B0-based remote API: simxGetObjectOrientation
Legacy remote API: simxGetObjectOrientation

All regular API functions on one page