Regular API function

simComputeMassAndInertia / sim.computeMassAndInertia

Description Computes and applies the mass and inertia matrix for a shape, based on its convex representation. When calling this function while the simulation is running, one should then call sim.resetDynamicObject, for the changes to take effect. See also sim.getShapeMassAndInertia and sim.convexDecompose.
C/C++
synopsis
int simComputeMassAndInertia(int shapeHandle,double density))
C/C++
parameters
shapeHandle: handle of shape
density: the density expressed in kg/m^3
C/C++
return value
-1 in case of an error, 0 if the shape is not convex, otherwise 1.
Lua
synopsis
int result=sim.computeMassAndInertia(int shapeHandle,float density)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
int result=sim.computeMassAndInertia(int shapeHandle,float density)