Shape:getCenterOfMass
EditReturns 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
Name | Type | Description |
x | number | The x position of the center of mass. |
y | number | The y position of the center of mass. |
z | number | 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.