Regular API function

simBuildMatrixQ / sim.buildMatrixQ

Description Builds a transformation matrix based on a position vector and a quaternion. See also the other matrix/transformation functions.
C/C++
synopsis
simInt simBuildMatrixQ(const simFloat* position,const simFloat* quaternion,simFloat* matrix)
C/C++
parameters
position: pointer to 3 simFloat values representing the position component
quaternion: pointer to 4 simFloat values representing the orientation quaternion (x,y,z,w)
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/C++
return value
-1 if operation was not successful
Lua synopsis table[12] matrix=sim.buildMatrixQ(table[3] position,table[4] quaternion)
Lua parameters
position: table of 3 numbers representing the position component
quaternion: table of 4 numbers representing the orientation quaternion (x,y,z,w)
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
Python synopsis list matrix=sim.buildMatrixQ(list position,list quaternion)