<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:41 CET 2013 -->
<title>World (libgdx API)
</title>
<meta name="date" content="2013-11-03">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="World (libgdx API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.
</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/World.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../../index-all.html">Index
</a></li>
<li><a href="../../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/badlogic/gdx/physics/box2d/Transform.html" title="class in com.badlogic.gdx.physics.box2d"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../../com/badlogic/gdx/physics/box2d/WorldManifold.html" title="class in com.badlogic.gdx.physics.box2d"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/physics/box2d/World.html" target="_top">Frames
</a></li>
<li><a href="World.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li><a href="#field_summary">Field
</a> |
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li><a href="#field_detail">Field
</a> |
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.badlogic.gdx.physics.box2d
</div>
<h2 title="Class World" class="title">Class World
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.physics.box2d.World
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:
</dt>
<dd><a href="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</a></dd>
</dl>
<hr>
<br>
<pre>public final class
<span class="strong">World
</span>
extends java.lang.Object
implements
<a href="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</a></pre>
<div class="block">The world class manages all physics entities, dynamic simulation, and asynchronous queries. The world also contains efficient
memory management facilities.
</div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner
</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Field and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/utils/LongMap.html" title="class in com.badlogic.gdx.utils">LongMap
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#bodies">bodies
</a></strong></code>
<div class="block">all known bodies
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactFilter.html" title="interface in com.badlogic.gdx.physics.box2d">ContactFilter
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#contactFilter">contactFilter
</a></strong></code>
<div class="block">Contact filter
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactListener.html" title="interface in com.badlogic.gdx.physics.box2d">ContactListener
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#contactListener">contactListener
</a></strong></code>
<div class="block">Contact listener
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/utils/LongMap.html" title="class in com.badlogic.gdx.utils">LongMap
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#fixtures">fixtures
</a></strong></code>
<div class="block">all known fixtures
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/utils/Pool.html" title="class in com.badlogic.gdx.utils">Pool
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#freeBodies">freeBodies
</a></strong></code>
<div class="block">pool for bodies
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/utils/Pool.html" title="class in com.badlogic.gdx.utils">Pool
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#freeFixtures">freeFixtures
</a></strong></code>
<div class="block">pool for fixtures
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/utils/LongMap.html" title="class in com.badlogic.gdx.utils">LongMap
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#joints">joints
</a></strong></code>
<div class="block">all known joints
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description
</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#World(com.badlogic.gdx.math.Vector2, boolean)">World
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> gravity,
boolean
doSleep)
</code>
<div class="block">Construct a world object.
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Method and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#clearForces()">clearForces
</a></strong>()
</code>
<div class="block">Manually clear the force buffer on all bodies.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#createBody(com.badlogic.gdx.physics.box2d.BodyDef)">createBody
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.html" title="class in com.badlogic.gdx.physics.box2d">BodyDef
</a> def)
</code>
<div class="block">Create a rigid body given a definition.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#createJoint(com.badlogic.gdx.physics.box2d.JointDef)">createJoint
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/JointDef.html" title="class in com.badlogic.gdx.physics.box2d">JointDef
</a> def)
</code>
<div class="block">Create a joint to constrain bodies together.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#destroyBody(com.badlogic.gdx.physics.box2d.Body)">destroyBody
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a> body)
</code>
<div class="block">Destroy a rigid body given a definition.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#destroyJoint(com.badlogic.gdx.physics.box2d.Joint)">destroyJoint
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a> joint)
</code>
<div class="block">Destroy a joint.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#dispose()">dispose
</a></strong>()
</code>
<div class="block">Releases all resources of this object.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getAutoClearForces()">getAutoClearForces
</a></strong>()
</code>
<div class="block">Get the flag that controls automatic clearing of forces after each time step.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getBodies(com.badlogic.gdx.utils.Array)">getBodies
</a></strong>(
<a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a>> bodies)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getBodyCount()">getBodyCount
</a></strong>()
</code>
<div class="block">Get the number of bodies.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getContactCount()">getContactCount
</a></strong>()
</code>
<div class="block">Get the number of contacts (each may have 0 or more contact points).
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Contact.html" title="class in com.badlogic.gdx.physics.box2d">Contact
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getContactList()">getContactList
</a></strong>()
</code>
<div class="block">Returns the list of
<a href="../../../../../com/badlogic/gdx/physics/box2d/Contact.html" title="class in com.badlogic.gdx.physics.box2d"><code>Contact
</code></a> instances produced by the last call to
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#step(float, int, int)"><code>step(float, int, int)
</code></a>.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getGravity()">getGravity
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getJointCount()">getJointCount
</a></strong>()
</code>
<div class="block">Get the number of joints.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getJoints(com.badlogic.gdx.utils.Array)">getJoints
</a></strong>(
<a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a>> joints)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getProxyCount()">getProxyCount
</a></strong>()
</code>
<div class="block">Get the number of broad-phase proxies.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#getVelocityThreshold()">getVelocityThreshold
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#isLocked()">isLocked
</a></strong>()
</code>
<div class="block">Is the world locked (in the middle of a time step).
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#QueryAABB(com.badlogic.gdx.physics.box2d.QueryCallback, float, float, float, float)">QueryAABB
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/QueryCallback.html" title="interface in com.badlogic.gdx.physics.box2d">QueryCallback
</a> callback,
float
lowerX,
float
lowerY,
float
upperX,
float
upperY)
</code>
<div class="block">Query the world for all fixtures that potentially overlap the provided AABB.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#rayCast(com.badlogic.gdx.physics.box2d.RayCastCallback, com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2)">rayCast
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/RayCastCallback.html" title="interface in com.badlogic.gdx.physics.box2d">RayCastCallback
</a> callback,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point1,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point2)
</code>
<div class="block">Ray-cast the world for all fixtures in the path of the ray.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setAutoClearForces(boolean)">setAutoClearForces
</a></strong>(boolean
flag)
</code>
<div class="block">Set flag to control automatic clearing of forces after each time step.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setContactFilter(com.badlogic.gdx.physics.box2d.ContactFilter)">setContactFilter
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactFilter.html" title="interface in com.badlogic.gdx.physics.box2d">ContactFilter
</a> filter)
</code>
<div class="block">Register a contact filter to provide specific control over collision.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setContactListener(com.badlogic.gdx.physics.box2d.ContactListener)">setContactListener
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactListener.html" title="interface in com.badlogic.gdx.physics.box2d">ContactListener
</a> listener)
</code>
<div class="block">Register a contact event listener.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setContinuousPhysics(boolean)">setContinuousPhysics
</a></strong>(boolean
flag)
</code>
<div class="block">Enable/disable continuous physics.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setDestructionListener(com.badlogic.gdx.physics.box2d.DestructionListener)">setDestructionListener
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/DestructionListener.html" title="interface in com.badlogic.gdx.physics.box2d">DestructionListener
</a> listener)
</code>
<div class="block">Register a destruction listener.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setGravity(com.badlogic.gdx.math.Vector2)">setGravity
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> gravity)
</code>
<div class="block">Change the global gravity vector.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setVelocityThreshold(float)">setVelocityThreshold
</a></strong>(float
threshold)
</code>
<div class="block">Sets the box2d velocity threshold globally, for all World instances.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setWarmStarting(boolean)">setWarmStarting
</a></strong>(boolean
flag)
</code>
<div class="block">Enable/disable warm starting.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#step(float, int, int)">step
</a></strong>(float
timeStep,
int
velocityIterations,
int
positionIterations)
</code>
<div class="block">Take a time step.
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class
java.lang.Object
</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail
</h3>
<a name="freeBodies">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>freeBodies
</h4>
<pre>protected final
<a href="../../../../../com/badlogic/gdx/utils/Pool.html" title="class in com.badlogic.gdx.utils">Pool
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a>> freeBodies
</pre>
<div class="block">pool for bodies
</div>
</li>
</ul>
<a name="freeFixtures">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>freeFixtures
</h4>
<pre>protected final
<a href="../../../../../com/badlogic/gdx/utils/Pool.html" title="class in com.badlogic.gdx.utils">Pool
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a>> freeFixtures
</pre>
<div class="block">pool for fixtures
</div>
</li>
</ul>
<a name="bodies">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bodies
</h4>
<pre>protected final
<a href="../../../../../com/badlogic/gdx/utils/LongMap.html" title="class in com.badlogic.gdx.utils">LongMap
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a>> bodies
</pre>
<div class="block">all known bodies
</div>
</li>
</ul>
<a name="fixtures">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fixtures
</h4>
<pre>protected final
<a href="../../../../../com/badlogic/gdx/utils/LongMap.html" title="class in com.badlogic.gdx.utils">LongMap
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a>> fixtures
</pre>
<div class="block">all known fixtures
</div>
</li>
</ul>
<a name="joints">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>joints
</h4>
<pre>protected final
<a href="../../../../../com/badlogic/gdx/utils/LongMap.html" title="class in com.badlogic.gdx.utils">LongMap
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a>> joints
</pre>
<div class="block">all known joints
</div>
</li>
</ul>
<a name="contactFilter">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>contactFilter
</h4>
<pre>protected
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactFilter.html" title="interface in com.badlogic.gdx.physics.box2d">ContactFilter
</a> contactFilter
</pre>
<div class="block">Contact filter
</div>
</li>
</ul>
<a name="contactListener">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>contactListener
</h4>
<pre>protected
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactListener.html" title="interface in com.badlogic.gdx.physics.box2d">ContactListener
</a> contactListener
</pre>
<div class="block">Contact listener
</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail
</h3>
<a name="World(com.badlogic.gdx.math.Vector2, boolean)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>World
</h4>
<pre>public
World(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> gravity,
boolean
doSleep)
</pre>
<div class="block">Construct a world object.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>gravity
</code> - the world gravity vector.
</dd><dd><code>doSleep
</code> - improve performance by not simulating inactive bodies.
</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="setDestructionListener(com.badlogic.gdx.physics.box2d.DestructionListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDestructionListener
</h4>
<pre>public
void
setDestructionListener(
<a href="../../../../../com/badlogic/gdx/physics/box2d/DestructionListener.html" title="interface in com.badlogic.gdx.physics.box2d">DestructionListener
</a> listener)
</pre>
<div class="block">Register a destruction listener. The listener is owned by you and must remain in scope.
</div>
</li>
</ul>
<a name="setContactFilter(com.badlogic.gdx.physics.box2d.ContactFilter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContactFilter
</h4>
<pre>public
void
setContactFilter(
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactFilter.html" title="interface in com.badlogic.gdx.physics.box2d">ContactFilter
</a> filter)
</pre>
<div class="block">Register a contact filter to provide specific control over collision. Otherwise the default filter is used
(b2_defaultFilter). The listener is owned by you and must remain in scope.
</div>
</li>
</ul>
<a name="setContactListener(com.badlogic.gdx.physics.box2d.ContactListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContactListener
</h4>
<pre>public
void
setContactListener(
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactListener.html" title="interface in com.badlogic.gdx.physics.box2d">ContactListener
</a> listener)
</pre>
<div class="block">Register a contact event listener. The listener is owned by you and must remain in scope.
</div>
</li>
</ul>
<a name="createBody(com.badlogic.gdx.physics.box2d.BodyDef)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createBody
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a> createBody(
<a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.html" title="class in com.badlogic.gdx.physics.box2d">BodyDef
</a> def)
</pre>
<div class="block">Create a rigid body given a definition. No reference to the definition is retained.
</div>
</li>
</ul>
<a name="destroyBody(com.badlogic.gdx.physics.box2d.Body)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroyBody
</h4>
<pre>public
void
destroyBody(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a> body)
</pre>
<div class="block">Destroy a rigid body given a definition. No reference to the definition is retained. This function is locked during
callbacks.
</div>
</li>
</ul>
<a name="createJoint(com.badlogic.gdx.physics.box2d.JointDef)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createJoint
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a> createJoint(
<a href="../../../../../com/badlogic/gdx/physics/box2d/JointDef.html" title="class in com.badlogic.gdx.physics.box2d">JointDef
</a> def)
</pre>
<div class="block">Create a joint to constrain bodies together. No reference to the definition is retained. This may cause the connected bodies
to cease colliding.
</div>
</li>
</ul>
<a name="destroyJoint(com.badlogic.gdx.physics.box2d.Joint)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroyJoint
</h4>
<pre>public
void
destroyJoint(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a> joint)
</pre>
<div class="block">Destroy a joint. This may cause the connected bodies to begin colliding.
</div>
</li>
</ul>
<a name="step(float, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>step
</h4>
<pre>public
void
step(float
timeStep,
int
velocityIterations,
int
positionIterations)
</pre>
<div class="block">Take a time step. This performs collision detection, integration, and constraint solution.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>timeStep
</code> - the amount of time to simulate, this should not vary.
</dd><dd><code>velocityIterations
</code> - for the velocity constraint solver.
</dd><dd><code>positionIterations
</code> - for the position constraint solver.
</dd></dl>
</li>
</ul>
<a name="clearForces()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearForces
</h4>
<pre>public
void
clearForces()
</pre>
<div class="block">Manually clear the force buffer on all bodies. By default, forces are cleared automatically after each call to Step. The
default behavior is modified by calling SetAutoClearForces. The purpose of this function is to support sub-stepping.
Sub-stepping is often used to maintain a fixed sized time step under a variable frame-rate. When you perform sub-stepping
you will disable auto clearing of forces and instead call ClearForces after all sub-steps are complete in one pass of your
game loop.
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#setAutoClearForces(boolean)"><code>setAutoClearForces(boolean)
</code></a></div>
</li>
</ul>
<a name="setWarmStarting(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setWarmStarting
</h4>
<pre>public
void
setWarmStarting(boolean
flag)
</pre>
<div class="block">Enable/disable warm starting. For testing.
</div>
</li>
</ul>
<a name="setContinuousPhysics(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContinuousPhysics
</h4>
<pre>public
void
setContinuousPhysics(boolean
flag)
</pre>
<div class="block">Enable/disable continuous physics. For testing.
</div>
</li>
</ul>
<a name="getProxyCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProxyCount
</h4>
<pre>public
int
getProxyCount()
</pre>
<div class="block">Get the number of broad-phase proxies.
</div>
</li>
</ul>
<a name="getBodyCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBodyCount
</h4>
<pre>public
int
getBodyCount()
</pre>
<div class="block">Get the number of bodies.
</div>
</li>
</ul>
<a name="getJointCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJointCount
</h4>
<pre>public
int
getJointCount()
</pre>
<div class="block">Get the number of joints.
</div>
</li>
</ul>
<a name="getContactCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContactCount
</h4>
<pre>public
int
getContactCount()
</pre>
<div class="block">Get the number of contacts (each may have 0 or more contact points).
</div>
</li>
</ul>
<a name="setGravity(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setGravity
</h4>
<pre>public
void
setGravity(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> gravity)
</pre>
<div class="block">Change the global gravity vector.
</div>
</li>
</ul>
<a name="getGravity()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGravity
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getGravity()
</pre>
</li>
</ul>
<a name="isLocked()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLocked
</h4>
<pre>public
boolean
isLocked()
</pre>
<div class="block">Is the world locked (in the middle of a time step).
</div>
</li>
</ul>
<a name="setAutoClearForces(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAutoClearForces
</h4>
<pre>public
void
setAutoClearForces(boolean
flag)
</pre>
<div class="block">Set flag to control automatic clearing of forces after each time step.
</div>
</li>
</ul>
<a name="getAutoClearForces()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAutoClearForces
</h4>
<pre>public
boolean
getAutoClearForces()
</pre>
<div class="block">Get the flag that controls automatic clearing of forces after each time step.
</div>
</li>
</ul>
<a name="QueryAABB(com.badlogic.gdx.physics.box2d.QueryCallback, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>QueryAABB
</h4>
<pre>public
void
QueryAABB(
<a href="../../../../../com/badlogic/gdx/physics/box2d/QueryCallback.html" title="interface in com.badlogic.gdx.physics.box2d">QueryCallback
</a> callback,
float
lowerX,
float
lowerY,
float
upperX,
float
upperY)
</pre>
<div class="block">Query the world for all fixtures that potentially overlap the provided AABB.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>callback
</code> - a user implemented callback class.
</dd><dd><code>lowerX
</code> - the x coordinate of the lower left corner
</dd><dd><code>lowerY
</code> - the y coordinate of the lower left corner
</dd><dd><code>upperX
</code> - the x coordinate of the upper right corner
</dd><dd><code>upperY
</code> - the y coordinate of the upper right corner
</dd></dl>
</li>
</ul>
<a name="getContactList()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContactList
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Contact.html" title="class in com.badlogic.gdx.physics.box2d">Contact
</a>> getContactList()
</pre>
<div class="block">Returns the list of
<a href="../../../../../com/badlogic/gdx/physics/box2d/Contact.html" title="class in com.badlogic.gdx.physics.box2d"><code>Contact
</code></a> instances produced by the last call to
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#step(float, int, int)"><code>step(float, int, int)
</code></a>. Note that the
returned list will have O(1) access times when using indexing. contacts are created and destroyed in the middle of a time
step. Use
<a href="../../../../../com/badlogic/gdx/physics/box2d/ContactListener.html" title="interface in com.badlogic.gdx.physics.box2d"><code>ContactListener
</code></a> to avoid missing contacts
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the contact list
</dd></dl>
</li>
</ul>
<a name="getBodies(com.badlogic.gdx.utils.Array)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBodies
</h4>
<pre>public
void
getBodies(
<a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html" title="class in com.badlogic.gdx.physics.box2d">Body
</a>> bodies)
</pre>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>bodies
</code> - an Array in which to place all bodies currently in the simulation
</dd></dl>
</li>
</ul>
<a name="getJoints(com.badlogic.gdx.utils.Array)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJoints
</h4>
<pre>public
void
getJoints(
<a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/Joint.html" title="class in com.badlogic.gdx.physics.box2d">Joint
</a>> joints)
</pre>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>joints
</code> - an Array in which to place all joints currently in the simulation
</dd></dl>
</li>
</ul>
<a name="dispose()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dispose
</h4>
<pre>public
void
dispose()
</pre>
<div class="block"><strong>Description copied from interface:
<code><a href="../../../../../com/badlogic/gdx/utils/Disposable.html#dispose()">Disposable
</a></code></strong></div>
<div class="block">Releases all resources of this object.
</div>
<dl>
<dt><strong>Specified by:
</strong></dt>
<dd><code><a href="../../../../../com/badlogic/gdx/utils/Disposable.html#dispose()">dispose
</a></code> in interface
<code><a href="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</a></code></dd>
</dl>
</li>
</ul>
<a name="setVelocityThreshold(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVelocityThreshold
</h4>
<pre>public static
void
setVelocityThreshold(float
threshold)
</pre>
<div class="block">Sets the box2d velocity threshold globally, for all World instances.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>threshold
</code> - the threshold, default 1.0f
</dd></dl>
</li>
</ul>
<a name="getVelocityThreshold()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVelocityThreshold
</h4>
<pre>public static
float
getVelocityThreshold()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the global box2d velocity threshold.
</dd></dl>
</li>
</ul>
<a name="rayCast(com.badlogic.gdx.physics.box2d.RayCastCallback, com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>rayCast
</h4>
<pre>public
void
rayCast(
<a href="../../../../../com/badlogic/gdx/physics/box2d/RayCastCallback.html" title="interface in com.badlogic.gdx.physics.box2d">RayCastCallback
</a> callback,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point1,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point2)
</pre>
<div class="block">Ray-cast the world for all fixtures in the path of the ray. The ray-cast ignores shapes that contain the starting point.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>callback
</code> - a user implemented callback class.
</dd><dd><code>point1
</code> - the ray starting point
</dd><dd><code>point2
</code> - the ray ending point
</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/World.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../../index-all.html">Index
</a></li>
<li><a href="../../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/badlogic/gdx/physics/box2d/Transform.html" title="class in com.badlogic.gdx.physics.box2d"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../../com/badlogic/gdx/physics/box2d/WorldManifold.html" title="class in com.badlogic.gdx.physics.box2d"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/physics/box2d/World.html" target="_top">Frames
</a></li>
<li><a href="World.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li><a href="#field_summary">Field
</a> |
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li><a href="#field_detail">Field
</a> |
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<div style="font-size:9pt"><i>
Copyright
© 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>