World

A world is an object that contains all bodies and joints.

Constructors

love.physics.newWorld Creates a new World.

Functions

Object:type Gets the type of the object as a string.
Object:typeOf Checks whether an object is of a certain type.
World:destroy Destroys the world. 0.8.0
World:getAllowSleeping Returns the sleep behaviour of the world. 0.8.0 0.9.0
World:getBodyCount Returns the number of bodies in the world.
World:getBodyList Returns a table with all bodies. 0.8.0
World:getCallbacks Returns functions for the callbacks during the world update.
World:getContactCount Returns the number of contacts in the world. 0.8.0
World:getContactFilter Returns the function for collision filtering. 0.8.0
World:getContactList Returns a table with all contacts. 0.8.0
World:getGravity Get the gravity of the world.
World:getJointCount Returns the number of joints in the world.
World:getJointList Returns a table with all joints. 0.8.0
World:isAllowSleep Get the sleep behaviour of the world. 0.8.0
World:isDestroyed Gets whether the World is destroyed. 0.9.2
World:isLocked Returns if the world is updating its state. 0.8.0
World:isSleepingAllowed Gets the sleep behaviour of the world. 0.9.0
World:queryBoundingBox Calls a function for each fixture inside the specified area. 0.8.0
World:rayCast Casts a ray and calls a function with the fixtures that intersect it. 0.8.0
World:setAllowSleep Set the sleep behaviour of the world. 0.8.0
World:setAllowSleeping Sets the sleep behaviour of the world. 0.8.0 0.9.0
World:setCallbacks Sets functions to be called when shapes collide. 0.8.0
World:setContactFilter Sets a function for collision filtering. 0.8.0
World:setGravity Set the gravity of the world.
World:setMeter Set the scale of the world. 0.8.0
World:setSleepingAllowed Sets the sleep behaviour of the world. 0.9.0
World:translateOrigin Translates the World's origin. 0.9.0
World:update Update the state of the world.

Supertypes

See Also


World:getAllowSleeping
  • References/Game Development/LÖVE/love.physics/World

World:getAllowSleeping Available since LÖVE 0.8.0 This method is not supported in earlier versions. Removed in LÖVE

2025-01-10 15:47:30
World:setMeter
  • References/Game Development/LÖVE/love.physics/World

World:setMeter Removed in LÖVE 0.8.0 This method is not supported in that and later versions. Set the scale of the world. The world scale

2025-01-10 15:47:30
World:isAllowSleep
  • References/Game Development/LÖVE/love.physics/World

World:isAllowSleep Removed in LÖVE 0.8.0 This method is not supported in that and later versions. Get the sleep behaviour of the world. A

2025-01-10 15:47:30
World:setCallbacks
  • References/Game Development/LÖVE/love.physics/World

World:setCallbacks Sets functions for the collision callbacks during the world update. Four Lua functions can be given as arguments. The value nil removes a function. When

2025-01-10 15:47:30
World:queryBoundingBox
  • References/Game Development/LÖVE/love.physics/World

World:queryBoundingBox Available since LÖVE 0.8.0 This method is not supported in earlier versions. Calls a function for each fixture inside

2025-01-10 15:47:30
World:destroy
  • References/Game Development/LÖVE/love.physics/World

World:destroy Available since LÖVE 0.8.0 This method is not supported in earlier versions. Destroys the world, taking all bodies, joints, fixtures

2025-01-10 15:47:30
World:setContactFilter
  • References/Game Development/LÖVE/love.physics/World

World:setContactFilter Available since LÖVE 0.8.0 This method is not supported in earlier versions. Sets a function for collision filtering

2025-01-10 15:47:30
World:setSleepingAllowed
  • References/Game Development/LÖVE/love.physics/World

World:setSleepingAllowed Available since LÖVE 0.9.0 It has been renamed from

2025-01-10 15:47:30
World:getJointCount
  • References/Game Development/LÖVE/love.physics/World

World:getJointCount Returns the number of joints in the world. Function Synopsis

2025-01-10 15:47:30
World:isLocked
  • References/Game Development/LÖVE/love.physics/World

World:isLocked Available since LÖVE 0.8.0 This method is not supported in earlier versions. Returns if the world is updating its state.

2025-01-10 15:47:30