Physics.P2#createBody()

createBody(x, y, mass, addToWorld, options, points) → {Phaser.Physics.P2.Body} Creates a new Body and adds it to the World. Parameters Name Type Argument Default Description x number The x coordinate of Body. y number The y coordinate of Body. mass number The mass of the Body. A mass of 0 means a 'static' Body is created. addToWorld boolean <optional> false Automatically add this Body to the world? (usually false as it won't have any shapes on construction). opti

Physics.P2#convertTilemap()

convertTilemap(map, layer, addToWorld, optimize) → {array} Goes through all tiles in the given Tilemap and TilemapLayer and converts those set to collide into physics bodies.Only call this after you have specified all of the tiles you wish to collide with calls like Tilemap.setCollisionBetween, etc.Every time you call this method it will destroy any previously created bodies and remove them from the world.Therefore understand it's a very expensive operation and not to be done in a core game u

Physics.P2#convertCollisionObjects()

convertCollisionObjects(map, layer, addToWorld) → {array} Converts all of the polylines objects inside a Tiled ObjectGroup into physics bodies that are added to the world.Note that the polylines must be created in such a way that they can withstand polygon decomposition. Parameters Name Type Argument Default Description map Phaser.Tilemap The Tilemap to get the map data from. layer number | string | Phaser.TilemapLayer <optional> The layer to operate on. If not given will de

Physics.P2#contactMaterial

contactMaterial :p2.ContactMaterial The default Contact Material being used by the World. Source code: physics/p2/World.js (Line 1879)

Physics.P2#collisionGroups

collisionGroups :array An array containing the collision groups that have been defined in the World. Source code: physics/p2/World.js (Line 212)

Physics.P2#clearTilemapLayerBodies()

clearTilemapLayerBodies(map, layer) Clears all physics bodies from the given TilemapLayer that were created with World.convertTilemap. Parameters Name Type Argument Description map Phaser.Tilemap The Tilemap to get the map data from. layer number | string | Phaser.TilemapLayer <optional> The layer to operate on. If not given will default to map.currentLayer. Source code: physics/p2/World.js (Line 1666)

Physics.P2#clear()

clear() Clears all bodies from the simulation, resets callbacks and resets the collision bitmask. The P2 world is also cleared: Removes all solver equations Removes all constraints Removes all bodies Removes all springs Removes all contact materials This is called automatically when you switch state. Source code: physics/p2/World.js (Line 800)

Physics.P2#callbackContext

callbackContext : Object The context under which the callbacks are fired. Source code: physics/p2/World.js (Line 170)

Physics.P2#boundsCollisionGroup

boundsCollisionGroup : Phaser.Physics.P2.CollisionGroup A default collision group. Source code: physics/p2/World.js (Line 222)

Physics.P2#boundsCollidesWith

boundsCollidesWith :array An array of the bodies the world bounds collides with. Source code: physics/p2/World.js (Line 232)