phaser/docs/Phaser.Physics.World.html

7502 lines
102 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Class: World</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapFont.html">BitmapFont</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Physics.World.html">World</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#canUseNewCanvasBlendModes">canUseNewCanvasBlendModes</a>
</li>
<li>
<a href="global.html#getBounds">getBounds</a>
</li>
<li>
<a href="global.html#getNextPowerOfTwo">getNextPowerOfTwo</a>
</li>
<li>
<a href="global.html#hex2rgb">hex2rgb</a>
</li>
<li>
<a href="global.html#hitTest">hitTest</a>
</li>
<li>
<a href="global.html#rgb2hex">rgb2hex</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="main">
<h1 class="page-title">Class: World</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="Phaser.html">Phaser</a><a href="Phaser.Physics.html">.Physics</a>.</span>
World
</h2>
<div class="class-description"><p>Physics World Constructor</p></div>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="World"><span class="type-signature"></span>new World<span class="signature">(game, <span class="optional">config</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>game</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Reference to the current game instance.</p></td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Physics configuration object passed in from the game constructor.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-29">line 29</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<h4 class="name" id="applyDamping"><span class="type-signature"></span>applyDamping<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>applyDamping</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Enable to automatically apply body damping each step.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-951">line 951</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="applyGravity"><span class="type-signature"></span>applyGravity<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>applyGravity</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Enable to automatically apply gravity each step.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-971">line 971</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="applySpringForces"><span class="type-signature"></span>applySpringForces<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>applySpringForces</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Enable to automatically apply spring forces each step.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-931">line 931</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="bounds"><span class="type-signature"></span>bounds<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>bounds</code></td>
<td class="type">
<span class="param-type">p2.Body</span>
</td>
<td class="description last"><p>The bounds body contains the 4 walls that border the World. Define or disable with setBounds.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-61">line 61</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="collisionGroups"><span class="type-signature"></span>collisionGroups<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>collisionGroups</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last"><p>Internal var.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-144">line 144</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="emitImpactEvent"><span class="type-signature"></span>emitImpactEvent<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>emitImpactEvent</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Set to true if you want to the world to emit the &quot;impact&quot; event. Turning this off could improve performance.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-1026">line 1026</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="enableBodySleeping"><span class="type-signature"></span>enableBodySleeping<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enableBodySleeping</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Enable / disable automatic body sleeping.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-1046">line 1046</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="friction"><span class="type-signature"></span>friction<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>friction</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Friction between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-891">line 891</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="game"><span class="type-signature"></span>game<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>game</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span>
</td>
<td class="description last"><p>Local reference to game.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-34">line 34</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="gravity"><span class="type-signature"></span>gravity<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>gravity</code></td>
<td class="type">
<span class="param-type">Phaser.InversePointProxy</span>
</td>
<td class="description last"><p>The gravity applied to all bodies each step.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-56">line 56</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="materials"><span class="type-signature">&lt;protected> </span>materials<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>materials</code></td>
<td class="type">
<span class="param-type">array.&lt;<a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a>></span>
</td>
<td class="description last"><p>A local array of all created Materials.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-51">line 51</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onBeginContact"><span class="type-signature"></span>onBeginContact<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onBeginContact</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a first contact is created between two bodies. This event is fired before the step has been done.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-127">line 127</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onBodyAdded"><span class="type-signature"></span>onBodyAdded<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onBodyAdded</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a new Body is added to the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-72">line 72</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onBodyRemoved"><span class="type-signature"></span>onBodyRemoved<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onBodyRemoved</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a Body is removed from the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-77">line 77</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onConstraintAdded"><span class="type-signature"></span>onConstraintAdded<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onConstraintAdded</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a new Constraint is added to the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-92">line 92</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onConstraintRemoved"><span class="type-signature"></span>onConstraintRemoved<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onConstraintRemoved</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a Constraint is removed from the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-97">line 97</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onContactMaterialAdded"><span class="type-signature"></span>onContactMaterialAdded<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onContactMaterialAdded</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a new ContactMaterial is added to the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-102">line 102</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onContactMaterialRemoved"><span class="type-signature"></span>onContactMaterialRemoved<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onContactMaterialRemoved</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a ContactMaterial is removed from the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-107">line 107</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onEndContact"><span class="type-signature"></span>onEndContact<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onEndContact</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when final contact occurs between two bodies. This event is fired before the step has been done.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-132">line 132</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onImpact"><span class="type-signature"></span>onImpact<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onImpact</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a first contact is created between two bodies. This event is fired after the step has been done.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-122">line 122</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onPostBroadphase"><span class="type-signature"></span>onPostBroadphase<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onPostBroadphase</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched after the Broadphase has collected collision pairs in the world.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-117">line 117</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onPostStep"><span class="type-signature"></span>onPostStep<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onPostStep</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched after the World.step()</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-112">line 112</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onSpringAdded"><span class="type-signature"></span>onSpringAdded<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onSpringAdded</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a new Spring is added to the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-82">line 82</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="onSpringRemoved"><span class="type-signature"></span>onSpringRemoved<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>onSpringRemoved</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>
</td>
<td class="description last"><p>Dispatched when a Spring is removed from the World.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-87">line 87</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="restituion"><span class="type-signature"></span>restituion<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>restitution</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Default coefficient of restitution between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-911">line 911</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="solveConstraints"><span class="type-signature"></span>solveConstraints<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>solveConstraints</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Enable/disable constraint solving in each step.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-991">line 991</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="time"><span class="type-signature">&lt;readonly> </span>time<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>time</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>The World time.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-1011">line 1011</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="world"><span class="type-signature">&lt;protected> </span>world<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>game</code></td>
<td class="type">
<span class="param-type">p2.World</span>
</td>
<td class="description last"><p>The p2 World in which the simulation is run.</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-45">line 45</a>
</li></ul></dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="addBody"><span class="type-signature"></span>addBody<span class="signature">(body)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
</dt>
<dd>
<div class="description">
<p>Add a body to the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>body</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a></span>
</td>
<td class="description last"><p>The Body to add to the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-468">line 468</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the Body was added successfully, otherwise false.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addConstraint"><span class="type-signature"></span>addConstraint<span class="signature">(constraint)</span><span class="type-signature"> &rarr; {Phaser.Physics.Constraint}</span></h4>
</dt>
<dd>
<div class="description">
<p>Adds a Constraint to the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>constraint</code></td>
<td class="type">
<span class="param-type">Phaser.Physics.Constraint</span>
</td>
<td class="description last"><p>The Constraint to add to the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-543">line 543</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Constraint that was added.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Phaser.Physics.Constraint</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addContactMaterial"><span class="type-signature"></span>addContactMaterial<span class="signature">(material)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Adds a Contact Material to the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>material</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a></span>
</td>
<td class="description last"><p>The Contact Material to be added to the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-577">line 577</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Contact Material that was added.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addSpring"><span class="type-signature"></span>addSpring<span class="signature">(spring)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Adds a Spring to the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>spring</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a></span>
</td>
<td class="description last"><p>The Spring to add to the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-509">line 509</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Spring that was added.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="createBody"><span class="type-signature"></span>createBody<span class="signature">(x, y, mass, <span class="optional">addToWorld</span>, options, points)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The x coordinate of Body.</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The y coordinate of Body.</p></td>
</tr>
<tr>
<td class="name"><code>mass</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The mass of the Body. A mass of 0 means a 'static' Body is created.</p></td>
</tr>
<tr>
<td class="name"><code>addToWorld</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Automatically add this Body to the world? (usually false as it won't have any shapes on construction).</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>An object containing the build options:</p>
<h6>Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>optimalDecomp</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.</p></td>
</tr>
<tr>
<td class="name"><code>skipSimpleCheck</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Set to true if you already know that the path is not intersecting itself.</p></td>
</tr>
<tr>
<td class="name"><code>removeCollinearPoints</code></td>
<td class="type">
<span class="param-type">boolean</span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Set to a number (angle threshold value) to remove collinear points, or false to keep all points.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>points</code></td>
<td class="type">
<span class="param-type"><a href="Array.html">Array</a>.&lt;number></span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>An array of 2d vectors that form the convex or concave polygon.
Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...],
or the arguments passed can be flat x,y values e.g. <code>setPolygon(options, x,y, x,y, x,y, ...)</code> where <code>x</code> and <code>y</code> are numbers.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-809">line 809</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="createBody"><span class="type-signature"></span>createBody<span class="signature">(x, y, mass, <span class="optional">addToWorld</span>, options, points)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The x coordinate of Body.</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The y coordinate of Body.</p></td>
</tr>
<tr>
<td class="name"><code>mass</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The mass of the Body. A mass of 0 means a 'static' Body is created.</p></td>
</tr>
<tr>
<td class="name"><code>addToWorld</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Automatically add this Body to the world? (usually false as it won't have any shapes on construction).</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>An object containing the build options:</p>
<h6>Properties</h6>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>optimalDecomp</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.</p></td>
</tr>
<tr>
<td class="name"><code>skipSimpleCheck</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Set to true if you already know that the path is not intersecting itself.</p></td>
</tr>
<tr>
<td class="name"><code>removeCollinearPoints</code></td>
<td class="type">
<span class="param-type">boolean</span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Set to a number (angle threshold value) to remove collinear points, or false to keep all points.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>points</code></td>
<td class="type">
<span class="param-type"><a href="Array.html">Array</a>.&lt;number></span>
|
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>An array of 2d vectors that form the convex or concave polygon.
Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...],
or the arguments passed can be flat x,y values e.g. <code>setPolygon(options, x,y, x,y, x,y, ...)</code> where <code>x</code> and <code>y</code> are numbers.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-848">line 848</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="createContactMaterial"><span class="type-signature"></span>createContactMaterial<span class="signature">(<span class="optional">materialA</span>, <span class="optional">materialB</span>, <span class="optional">options</span>)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Creates a Contact Material from the two given Materials. You can then edit the properties of the Contact Material directly.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>materialA</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>The first Material to create the ContactMaterial from. If undefined it will create a new Material object first.</p></td>
</tr>
<tr>
<td class="name"><code>materialB</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>The second Material to create the ContactMaterial from. If undefined it will create a new Material object first.</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Material options object.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-670">line 670</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Contact Material that was created.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="createMaterial"><span class="type-signature"></span>createMaterial<span class="signature">(<span class="optional">name</span>, <span class="optional">body</span>)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Creates a Material. Materials are applied to Shapes owned by a Body and can be set with Body.setMaterial().
Materials are a way to control what happens when Shapes collide. Combine unique Materials together to create Contact Materials.
Contact Materials have properties such as friction and restitution that allow for fine-grained collision control between different Materials.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Optional name of the Material. Each Material has a unique ID but string names are handy for debugging.</p></td>
</tr>
<tr>
<td class="name"><code>body</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"><p>Optional Body. If given it will assign the newly created Material to the Body shapes.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-643">line 643</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Material that was created. This is also stored in Phaser.Physics.World.materials.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-457">line 457</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getBodies"><span class="type-signature"></span>getBodies<span class="signature">()</span><span class="type-signature"> &rarr; {array.&lt;<a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a>>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Populates and returns an array of all current Bodies in the world.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-690">line 690</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An array containing all current Bodies in the world.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">array.&lt;<a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a>></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getConstraints"><span class="type-signature"></span>getConstraints<span class="signature">()</span><span class="type-signature"> &rarr; {array.&lt;Phaser.Physics.Constraints>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Populates and returns an array of all current Constraints in the world.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-730">line 730</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An array containing all current Constraints in the world.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">array.&lt;Phaser.Physics.Constraints></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getContactMaterial"><span class="type-signature"></span>getContactMaterial<span class="signature">(materialA, materialB)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a>|boolean}</span></h4>
</dt>
<dd>
<div class="description">
<p>Gets a Contact Material based on the two given Materials.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>materialA</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a></span>
</td>
<td class="description last"><p>The first Material to search for.</p></td>
</tr>
<tr>
<td class="name"><code>materialB</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a></span>
</td>
<td class="description last"><p>The second Material to search for.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-611">line 611</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Contact Material or false if none was found matching the Materials given.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a></span>
|
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getSprings"><span class="type-signature"></span>getSprings<span class="signature">()</span><span class="type-signature"> &rarr; {array.&lt;<a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a>>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Populates and returns an array of all current Springs in the world.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-710">line 710</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An array containing all current Springs in the world.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">array.&lt;<a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a>></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="hitTest"><span class="type-signature"></span>hitTest<span class="signature">(worldPoint, bodies, precision)</span><span class="type-signature"> &rarr; {<a href="Array.html">Array</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Test if a world point overlaps bodies.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>worldPoint</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>
</td>
<td class="description last"><p>Point to use for intersection tests.</p></td>
</tr>
<tr>
<td class="name"><code>bodies</code></td>
<td class="type">
<span class="param-type"><a href="Array.html">Array</a></span>
</td>
<td class="description last"><p>A list of objects to check for intersection.</p></td>
</tr>
<tr>
<td class="name"><code>precision</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Used for matching against particles and lines. Adds some margin to these infinitesimal objects.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-750">line 750</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Array of bodies that overlap the point.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Array.html">Array</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeBody"><span class="type-signature"></span>removeBody<span class="signature">(body)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Removes a body from the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>body</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a></span>
</td>
<td class="description last"><p>The Body to remove from the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-492">line 492</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Body that was removed.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeConstraint"><span class="type-signature"></span>removeConstraint<span class="signature">(constraint)</span><span class="type-signature"> &rarr; {Phaser.Physics.Constraint}</span></h4>
</dt>
<dd>
<div class="description">
<p>Removes a Constraint from the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>constraint</code></td>
<td class="type">
<span class="param-type">Phaser.Physics.Constraint</span>
</td>
<td class="description last"><p>The Constraint to be removed from the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-560">line 560</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Constraint that was removed.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Phaser.Physics.Constraint</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeContactMaterial"><span class="type-signature"></span>removeContactMaterial<span class="signature">(material)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Removes a Contact Material from the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>material</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a></span>
</td>
<td class="description last"><p>The Contact Material to be removed from the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-594">line 594</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Contact Material that was removed.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.ContactMaterial.html">Phaser.Physics.ContactMaterial</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeSpring"><span class="type-signature"></span>removeSpring<span class="signature">(spring)</span><span class="type-signature"> &rarr; {<a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Removes a Spring from the world.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>spring</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a></span>
</td>
<td class="description last"><p>The Spring to remove from the World.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-526">line 526</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>The Spring that was removed.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Phaser.Physics.Spring.html">Phaser.Physics.Spring</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="setBounds"><span class="type-signature"></span>setBounds<span class="signature">(x, y, width, height, <span class="optional">left</span>, <span class="optional">right</span>, <span class="optional">top</span>, <span class="optional">bottom</span>, <span class="optional">setCollisionGroup</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Sets the bounds of the Physics world to match the given world pixel dimensions.
You can optionally set which 'walls' to create: left, right, top or bottom.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The x coordinate of the top-left corner of the bounds.</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The y coordinate of the top-left corner of the bounds.</p></td>
</tr>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The width of the bounds.</p></td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The height of the bounds.</p></td>
</tr>
<tr>
<td class="name"><code>left</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
true
</td>
<td class="description last"><p>If true will create the left bounds wall.</p></td>
</tr>
<tr>
<td class="name"><code>right</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
true
</td>
<td class="description last"><p>If true will create the right bounds wall.</p></td>
</tr>
<tr>
<td class="name"><code>top</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
true
</td>
<td class="description last"><p>If true will create the top bounds wall.</p></td>
</tr>
<tr>
<td class="name"><code>bottom</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
true
</td>
<td class="description last"><p>If true will create the bottom bounds wall.</p></td>
</tr>
<tr>
<td class="name"><code>setCollisionGroup</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
true
</td>
<td class="description last"><p>If true the Bounds will be set to use its own Collision Group.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-340">line 340</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="setMaterial"><span class="type-signature"></span>setMaterial<span class="signature">(material, bodies)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Sets the given Material against all Shapes owned by all the Bodies in the given array.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>material</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Physics.Material.html">Phaser.Physics.Material</a></span>
</td>
<td class="description last"><p>The Material to be applied to the given Bodies.</p></td>
</tr>
<tr>
<td class="name"><code>bodies</code></td>
<td class="type">
<span class="param-type">array.&lt;<a href="Phaser.Physics.Body.html">Phaser.Physics.Body</a>></span>
</td>
<td class="description last"><p>An Array of Body objects that the given Material will be set on.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-625">line 625</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="toJSON"><span class="type-signature"></span>toJSON<span class="signature">()</span><span class="type-signature"> &rarr; {object}</span></h4>
</dt>
<dd>
<div class="description">
<p>Converts the current world into a JSON object.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-763">line 763</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A JSON representation of the world.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="update"><span class="type-signature"></span>update<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="World.js.html">physics/World.js</a>, <a href="World.js.html#sunlight-1-line-448">line 448</a>
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<div class="span3">
<div id="toc"></div>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>