Shape:getCenterOfMass

Edit

Returns the center of mass of the Shape. Currently the only shape that can have a non-zero center of mass is ConvexShape.

x, y, z = Shape:getCenterOfMass()

Arguments

None

Returns

NameTypeDescription
xnumber The x position of the center of mass.
ynumber The y position of the center of mass.
znumber The z position of the center of mass.

Notes

MeshShape and TerrainShape do not have a well-defined mass, this function returns zero for those shapes.

See also