Regular API function

simGetShapeInertia / sim.getShapeInertia

Description Retrieves the inertia information from a shape. See also sim.setShapeInertia, sim.getShapeMass and sim.computeMassAndInertia.
C/C++
synopsis
int simGetShapeInertia(int shapeHandle,double* inertiaMatrix,double* com)
C/C++
parameters
shapeHandle: handle of the shape object
inertiaMatrix (output): the inertia matrix (9 values), expressed relative to the shape's reference frame orientation. The matrix is symmetric
com (output): a transformation matrix (12 values) indicating the center of mass, expressed relative to the shape's reference frame. The matrix does not contain any rotational part (only the positional values are relevant).
C/C++
return value
-1 in case of an error
Lua
synopsis
float[9] inertiaMatrix,float[12] com=sim.getShapeInertia(int shapeHandle)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
list inertiaMatrix,list com=sim.getShapeInertia(int shapeHandle)