Regular API function

simSetShapeInertia / sim.setShapeInertia

Description Applies a new inertia tensor to a shape. If simulation is running, the shape will be dynamically reset (similar to calling sim.resetDynamicObject right after). See also sim.getShapeInertia, sim.setShapeMass and sim.computeMassAndInertia.
C/C++
synopsis
simInt simSetShapeInertia(simInt shapeHandle,const simFloat* inertiaMatrix,const simFloat* transformationMatrix)
C/C++
parameters
shapeHandle: handle of the shape object
inertiaMatrix: the new inertia matrix or tensor (9 values), expressed relative to transformationMatrix (which should coincide with the center of mass). The matrix should be symmetric.
transformationMatrix: 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
sim.setShapeInertia(int shapeHandle,float[9] inertiaMatrix,float[12] transformationMatrix)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Python
synopsis
sim.setShapeInertia(int shapeHandle,list inertiaMatrix,list transformationMatrix)