Body:getUserData

Body:getUserData Available since LÖVE 0.9.1 This method is not supported in earlier versions. Returns the Lua value associated with this Body. Use this function in one thread and one thread only. Using it in more threads will make Lua cry and most likely crash. Function Synopsis value = Body:getUserData( ) Arguments None. Returns any value The Lua value associated with the Body. See Also Body Body:setUserData

Body:getType

Body:getType Available since LÖVE 0.8.0 This method is not supported in earlier versions. Returns the type of the body. Function Synopsis type = Body:getType( ) Arguments None. Returns BodyType type The body type. See Also Body Body:setType

Body:getPosition

Body:getPosition Get the position of the body. Note that this may not be the center of mass of the body. Function Synopsis x, y = Body:getPosition( ) Arguments None. Returns number x The x position. number y The y position. See Also Body

Body:getMassData

Body:getMassData Available since LÖVE 0.8.0 This method is not supported in earlier versions. Returns the mass, its center, and the rotational inertia. Function Synopsis x, y, mass, inertia = Body:getMassData( ) Arguments None. Returns number x The x position of the center of mass. number y The y position of the center of mass. number mass The mass of the body. number inertia The rotational inertia. See Also Body Body:setMassData

Body:getMass

Body:getMass Get the mass of the body. Static bodies always have a mass of 0. Function Synopsis mass = Body:getMass( ) Arguments None. Returns number mass The mass of the body (in kilograms). See Also Body

Body:getLocalVector

Body:getLocalVector Transform a vector from world coordinates to local coordinates. Function Synopsis localX, localY = Body:getLocalVector( worldX, worldY ) Arguments number worldX The vector x component in world coordinates. number worldY The vector y component in world coordinates. Returns number localX The vector x component in local coordinates. number localY The vector y component in local coordinates. See Also Body

Body:getLocalPoint

Body:getLocalPoint Transform a point from world coordinates to local coordinates. Function Synopsis localX, localY = Body:getLocalPoint( worldX, worldY ) Arguments number worldX The x position in world coordinates. number worldY The y position in world coordinates. Returns number localX The x position in local coordinates. number localY The y position in local coordinates. See Also Body

Body:getLocalCenter

Body:getLocalCenter Get the center of mass position in local coordinates. Use Body:getWorldCenter to get the center of mass in world coordinates. Function Synopsis x, y = Body:getLocalCenter( ) Arguments None. Returns number x The x coordinate of the center of mass. number y The y coordinate of the center of mass. See Also Body

Body:getLinearVelocityFromWorldPoint

Body:getLinearVelocityFromWorldPoint Get the linear velocity of a point on the body. The linear velocity for a point on the body is the velocity of the body center of mass plus the velocity at that point from the body spinning. The point on the body must given in world coordinates. Use Body:getLinearVelocityFromLocalPoint to specify this with local coordinates. Function Synopsis vx, vy = Body:getLinearVelocityFromWorldPoint( x, y ) Arguments number x The x position to measure velocity. num

Body:getLinearVelocityFromLocalPoint

Body:getLinearVelocityFromLocalPoint Get the linear velocity of a point on the body. The linear velocity for a point on the body is the velocity of the body center of mass plus the velocity at that point from the body spinning. The point on the body must given in local coordinates. Use Body:getLinearVelocityFromWorldPoint to specify this with world coordinates. Function Synopsis vx, vy = Body:getLinearVelocityFromLocalPoint( x, y ) Arguments number x The x position to measure velocity. num