Physics.P2.Body#addCircle()

addCircle(radius, offsetX, offsetY, rotation) → {p2.Circle} Adds a Circle shape to this Body. You can control the offset from the center of the body and the rotation. Parameters Name Type Argument Default Description radius number The radius of this circle (in pixels) offsetX number <optional> 0 Local horizontal offset of the shape relative to the body center of mass. offsetY number <optional> 0 Local vertical offset of the shape relative to the body center of mas

Physics.P2.Body#addCapsule()

addCapsule(length, radius, offsetX, offsetY, rotation) → {p2.Capsule} Adds a Capsule shape to this Body.You can control the offset from the center of the body and the rotation. Parameters Name Type Argument Default Description length number The distance between the end points in pixels. radius number Radius of the capsule in pixels. offsetX number <optional> 0 Local horizontal offset of the shape relative to the body center of mass. offsetY number <optional>

Physics.P2#walls

walls : Object An object containing the 4 wall bodies that bound the physics world. Source code: physics/p2/World.js (Line 88)

Physics.P2#useElapsedTime

useElapsedTime : boolean If true the frameRate value will be ignored and instead p2 will step with the value of Game.Time.physicsElapsed, which is a delta time value. Source code: physics/p2/World.js (Line 66)

Physics.P2#updateBoundsCollisionGroup()

updateBoundsCollisionGroup(setCollisionGroup) By default the World will be set to collide everything with everything. The bounds of the world is a Body with 4 shapes, one for each face.If you start to use your own collision groups then your objects will no longer collide with the bounds.To fix this you need to adjust the bounds to use its own collision group first BEFORE changing your Sprites collision group. Parameters Name Type Argument Default Description setCollisionGroup boolean <

Physics.P2#update()

update() Internal P2 update loop. Source code: physics/p2/World.js (Line 755)

Physics.P2#total

[readonly] total : number The total number of bodies in the world. Source code: physics/p2/World.js (Line 2036)

Physics.P2#toJSON()

toJSON() → {object} Converts the current world into a JSON object. Returns object - A JSON representation of the world. Source code: physics/p2/World.js (Line 1399)

Physics.P2#time

[readonly] time : boolean The World time. Source code: physics/p2/World.js (Line 1979)

Physics.P2#solveConstraints

solveConstraints : boolean Enable/disable constraint solving in each step. Source code: physics/p2/World.js (Line 1959)