Type Function Object Body Library physics.* Return value Number Revision Release 2026.3728 Keywords body, inertia See also physics.addBody()
Returns the rotational inertia of the physics body about its center of mass.
object:getInertia()
-- Create a rectangle
local myRect = display.newRect( 0, 0, 100, 100 )
-- Add a body
physics.addBody( myRect, "dynamic" )
-- Get the rotational inertia
local inertia = myRect:getInertia()
if inertia then
print( "Rotational inertia: " .. inertia )
else
print( "Object does not have a physics body" )
end