Regular API function

simBuildMatrix / sim.buildMatrix

Description Builds a transformation matrix based on a position vector and Euler angles. See also the other matrix/transformation functions.
C synopsis simInt simBuildMatrix(const simFloat* position,const simFloat* eulerAngles,simFloat* matrix)
C parameters
position: pointer to 3 simFloat values representing the position component
eulerAngles: pointer to 3 simFloat values representing the angular component
matrix: pointer to 12 simFloat values representing the transformation matrix
The x-axis of the orientation component of the matrix is (matrix[0],matrix[4],matrix[8])
The y-axis of the orientation component of the matrix is (matrix[1],matrix[5],matrix[9])
The z-axis of the orientation component of the matrix is (matrix[2],matrix[6],matrix[10])
The position component of the matrix is (matrix[3],matrix[7],matrix[11])
C return value
-1 if operation was not successful
Lua synopsis table[12] matrix=sim.buildMatrix(table[3] position,table[3] eulerAngles)
Lua parameters
position: table to 3 numbers representing the position component
eulerAngles: table to 3 numbers representing the angular component
Lua return values
matrix: table containing the transformation matrix (except for the last row). Note: table values in Lua are indexed from 1, not 0.