Difference between revisions of "World"

m (1 revision: Imported docs from potato.)
Line 1: Line 1:
  
 +
A world is an object that contains all bodies and joints.
 +
 +
Create a new world with [[love.physics.newWorld]].
 +
 +
 +
A world can call these functions:
  
 
== Functions ==
 
== Functions ==
Line 10: Line 16:
 
* [[love.physics.newWorld]]
 
* [[love.physics.newWorld]]
 
[[Category:Types]]
 
[[Category:Types]]
{{#set:Description=}}
+
{{#set:Description=A world is an object that contains all bodies and joints.
 +
}}

Revision as of 16:17, 14 February 2010

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

Create a new world with love.physics.newWorld.


A world can call these functions:

Functions

World:destroyDestroys the world.
World:getAllowSleepingReturns the sleep behaviour of the world.
World:getBodiesReturns a table with all bodies.
World:getBodyCountReturns the number of bodies in the world.
World:getBodyListReturns a table with all bodies.
World:getCallbacksReturns functions for the callbacks during the world update.
World:getContactCountReturns the number of contacts in the world.
World:getContactFilterReturns the function for collision filtering.
World:getContactListReturns a table with all contacts.
World:getContactsReturns a table with all Contacts.
World:getGravityGet the gravity of the world.
World:getJointCountReturns the number of joints in the world.
World:getJointListReturns a table with all joints.
World:getJointsReturns a table with all joints.
World:getMeterGet the scale of the world.
World:getShapesInAreaGets a list of Shapes inside the specified area
World:isAllowSleepGet the sleep behaviour of the world.
World:isDestroyedGets whether the World is destroyed.
World:isLockedReturns if the world is updating its state.
World:isSleepingAllowedGets the sleep behaviour of the world.
World:queryBoundingBoxCalls a function for each fixture inside the specified area.
World:queryShapesInAreaCalls a function for each Shape inside the specified area.
World:rayCastCasts a ray and calls a function with the fixtures that intersect it.
World:rayCastAnyCasts a ray and returns an intersection point if the ray touched any Shape in the world.
World:rayCastClosestCasts a ray and returns the intersection point of the closest Shape touched by the ray, if any.
World:setAllowSleepSet the sleep behaviour of the world.
World:setAllowSleepingSets the sleep behaviour of the world.
World:setCallbacksSets functions to be called when shapes collide.
World:setContactFilterSets a function for collision filtering.
World:setGravitySet the gravity of the world.
World:setMeterSet the scale of the world.
World:setSleepingAllowedSets the sleep behaviour of the world.
World:translateOriginTranslates the World's origin.
World:updateUpdate the state of the world.

See Also