Regular API function

simGetEulerAnglesFromMatrix

Description Retrieves the Euler angles from a transformation matrix. See also the other matrix/transformation functions.
C synopsis simInt simGetEulerAnglesFromMatrix(const simFloat* matrix,simFloat* eulerAngles)
C parameters
matrix: pointer to 12 simFloat values (the last row of the 4x4 matrix (0,0,0,1) is not needed)
The x-axis of the orientation component is (matrix[0],matrix[4],matrix[8])
The y-axis of the orientation component is (matrix[1],matrix[5],matrix[9])
The z-axis of the orientation component is (matrix[2],matrix[6],matrix[10])
The position component is (matrix[3],matrix[7],matrix[11])
eulerAngles: pointer to 3 simFloat values representing the Euler angles of the matrix
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=simGetEulerAnglesFromMatrix(table_12 matrix)
Lua parameters
matrix: table to 12 numbers (the last row of the 4x4 matrix (0,0,0,1) is not needed). Table values in Lua are indexed from 1, not 0!
Lua return values
eulerAngles: table to 3 numbers representing the Euler angles, or nil in case of an error

All regular API functions on one page