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
simInt simGetShapeInertia(simInt shapeHandle,simFloat* inertiaMatrix,simFloat* transformationMatrix)
C/C++
parameters
shapeHandle: handle of the shape object
inertiaMatrix (output): the inertia matrix or tensor (9 values), expressed relative to transformationMatrix (which coincides with the center of mass). The matrix is diagonal, i.e. contains the principal moments of inertia.
transformationMatrix (output): a transformation matrix (12 values) expressed relative to the shape's reference frame. The matrix indicates the center of mass of the shape, and is the frame relative to which inertiaMatrix is expressed.
C/C++
return value
-1 in case of an error
Lua
synopsis
float[9] inertiaMatrix,float[12] transformationMatrix=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 transformationMatrix=sim.getShapeInertia(int shapeHandle)

<