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 number result=sim.computeMassAndInertia(number shapeHandle,number density)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page