Regular API function

simComputeMassAndInertia / sim.computeMassAndInertia

Description Computes and applies the mass and inertia properties for a convex shape (or convex compound shape), based on a density value. If call this function while the simulation is running, you will have to call sim.resetDynamicObject upon the object, for the changes to take effect. See also sim.getShapeMassAndInertia and sim.convexDecompose.
C synopsis simInt simComputeMassAndInertia(simInt shapeHandle,simFloat density))
C parameters
shapeHandle: handle of shape. The shape must be convex (or a convex compound).
density: the density expressed in kg/m^3
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