<!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>Body (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="Body (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/Body.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>Prev Class
</li>
<li><a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.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/Body.html" target="_top">Frames
</a></li>
<li><a href="Body.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 Body" class="title">Class Body
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.physics.box2d.Body
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class
<span class="strong">Body
</span>
extends java.lang.Object
</pre>
<div class="block">A rigid body. These are created via World.CreateBody.
</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 long
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#addr">addr
</a></strong></code>
<div class="block">the address of the body
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected
<a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/JointEdge.html" title="class in com.badlogic.gdx.physics.box2d">JointEdge
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#joints">joints
</a></strong></code>
<div class="block">Joints of this body
</div>
</td>
</tr>
<tr class="altColor">
<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/Body.html#linVelLoc">linVelLoc
</a></strong></code> </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/Body.html#linVelWorld">linVelWorld
</a></strong></code> </td>
</tr>
<tr class="altColor">
<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/Body.html#localPoint2">localPoint2
</a></strong></code> </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/Body.html#localVector">localVector
</a></strong></code> </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="colFirst" scope="col">Modifier
</th>
<th class="colLast" scope="col">Constructor and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#Body(com.badlogic.gdx.physics.box2d.World, long)">Body
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html" title="class in com.badlogic.gdx.physics.box2d">World
</a> world,
long
addr)
</code>
<div class="block">Constructs a new body with the given address
</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/Body.html#applyAngularImpulse(float, boolean)">applyAngularImpulse
</a></strong>(float
impulse,
boolean
wake)
</code>
<div class="block">Apply an angular impulse.
</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/Body.html#applyForce(float, float, float, float, boolean)">applyForce
</a></strong>(float
forceX,
float
forceY,
float
pointX,
float
pointY,
boolean
wake)
</code>
<div class="block">Apply a force at a world point.
</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/Body.html#applyForce(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2, boolean)">applyForce
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> force,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point,
boolean
wake)
</code>
<div class="block">Apply a force at a world point.
</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/Body.html#applyForceToCenter(float, float, boolean)">applyForceToCenter
</a></strong>(float
forceX,
float
forceY,
boolean
wake)
</code>
<div class="block">Apply a force to the center of mass.
</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/Body.html#applyForceToCenter(com.badlogic.gdx.math.Vector2, boolean)">applyForceToCenter
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> force,
boolean
wake)
</code>
<div class="block">Apply a force to the center of mass.
</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/Body.html#applyLinearImpulse(float, float, float, float, boolean)">applyLinearImpulse
</a></strong>(float
impulseX,
float
impulseY,
float
pointX,
float
pointY,
boolean
wake)
</code>
<div class="block">Apply an impulse at a point.
</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/Body.html#applyLinearImpulse(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2, boolean)">applyLinearImpulse
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> impulse,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point,
boolean
wake)
</code>
<div class="block">Apply an impulse at a point.
</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/Body.html#applyTorque(float, boolean)">applyTorque
</a></strong>(float
torque,
boolean
wake)
</code>
<div class="block">Apply a torque.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><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/Body.html#createFixture(com.badlogic.gdx.physics.box2d.FixtureDef)">createFixture
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/FixtureDef.html" title="class in com.badlogic.gdx.physics.box2d">FixtureDef
</a> def)
</code>
<div class="block">Creates a fixture and attach it to this body.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><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/Body.html#createFixture(com.badlogic.gdx.physics.box2d.Shape, float)">createFixture
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Shape.html" title="class in com.badlogic.gdx.physics.box2d">Shape
</a> shape,
float
density)
</code>
<div class="block">Creates a fixture from a shape and attach it to this body.
</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/Body.html#destroyFixture(com.badlogic.gdx.physics.box2d.Fixture)">destroyFixture
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a> fixture)
</code>
<div class="block">Destroy a fixture.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getAngle()">getAngle
</a></strong>()
</code>
<div class="block">Get the angle in radians.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getAngularDamping()">getAngularDamping
</a></strong>()
</code>
<div class="block">Get the angular damping of the body.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getAngularVelocity()">getAngularVelocity
</a></strong>()
</code>
<div class="block">Get the angular velocity.
</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/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/Body.html#getFixtureList()">getFixtureList
</a></strong>()
</code>
<div class="block">Get the list of all fixtures attached to this body.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getGravityScale()">getGravityScale
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getInertia()">getInertia
</a></strong>()
</code>
<div class="block">Get the rotational inertia of the body about the local origin.
</div>
</td>
</tr>
<tr class="rowColor">
<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/JointEdge.html" title="class in com.badlogic.gdx.physics.box2d">JointEdge
</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getJointList()">getJointList
</a></strong>()
</code>
<div class="block">Get the list of all joints attached to this body.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getLinearDamping()">getLinearDamping
</a></strong>()
</code>
<div class="block">Get the linear damping of the body.
</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/Body.html#getLinearVelocity()">getLinearVelocity
</a></strong>()
</code>
<div class="block">Get the linear velocity of the center of mass.
</div>
</td>
</tr>
<tr class="altColor">
<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/Body.html#getLinearVelocityFromLocalPoint(com.badlogic.gdx.math.Vector2)">getLinearVelocityFromLocalPoint
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localPoint)
</code>
<div class="block">Get the world velocity of a local point.
</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/Body.html#getLinearVelocityFromWorldPoint(com.badlogic.gdx.math.Vector2)">getLinearVelocityFromWorldPoint
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> worldPoint)
</code>
<div class="block">Get the world linear velocity of a world point attached to this body.
</div>
</td>
</tr>
<tr class="altColor">
<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/Body.html#getLocalCenter()">getLocalCenter
</a></strong>()
</code>
<div class="block">Get the local position of the center of mass.
</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/Body.html#getLocalPoint(com.badlogic.gdx.math.Vector2)">getLocalPoint
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> worldPoint)
</code>
<div class="block">Gets a local point relative to the body's origin given a world point.
</div>
</td>
</tr>
<tr class="altColor">
<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/Body.html#getLocalVector(com.badlogic.gdx.math.Vector2)">getLocalVector
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> worldVector)
</code>
<div class="block">Gets a local vector given a world vector.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getMass()">getMass
</a></strong>()
</code>
<div class="block">Get the total mass of the body.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/physics/box2d/MassData.html" title="class in com.badlogic.gdx.physics.box2d">MassData
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getMassData()">getMassData
</a></strong>()
</code>
<div class="block">Get the mass data of the body.
</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/Body.html#getPosition()">getPosition
</a></strong>()
</code>
<div class="block">Get the world body origin position.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/physics/box2d/Transform.html" title="class in com.badlogic.gdx.physics.box2d">Transform
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getTransform()">getTransform
</a></strong>()
</code>
<div class="block">Get the body transform for the body's origin.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.BodyType.html" title="enum in com.badlogic.gdx.physics.box2d">BodyDef.BodyType
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getType()">getType
</a></strong>()
</code>
<div class="block">Get the type of this body.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Object
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getUserData()">getUserData
</a></strong>()
</code>
<div class="block">Get the user data
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/physics/box2d/World.html" title="class in com.badlogic.gdx.physics.box2d">World
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#getWorld()">getWorld
</a></strong>()
</code>
<div class="block">Get the parent world of this body.
</div>
</td>
</tr>
<tr class="altColor">
<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/Body.html#getWorldCenter()">getWorldCenter
</a></strong>()
</code>
<div class="block">Get the world position of the center of mass.
</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/Body.html#getWorldPoint(com.badlogic.gdx.math.Vector2)">getWorldPoint
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localPoint)
</code>
<div class="block">Get the world coordinates of a point given the local coordinates.
</div>
</td>
</tr>
<tr class="altColor">
<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/Body.html#getWorldVector(com.badlogic.gdx.math.Vector2)">getWorldVector
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localVector)
</code>
<div class="block">Get the world coordinates of a vector given the local coordinates.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#isActive()">isActive
</a></strong>()
</code>
<div class="block">Get the active state of the body.
</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/Body.html#isAwake()">isAwake
</a></strong>()
</code>
<div class="block">Get the sleeping state of this body.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#isBullet()">isBullet
</a></strong>()
</code>
<div class="block">Is this body treated like a bullet for continuous collision detection?
</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/Body.html#isFixedRotation()">isFixedRotation
</a></strong>()
</code>
<div class="block">Does this body have fixed rotation?
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#isSleepingAllowed()">isSleepingAllowed
</a></strong>()
</code>
<div class="block">Is this body allowed to sleep
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/physics/box2d/Body.html#reset(long)">reset
</a></strong>(long
addr)
</code>
<div class="block">Resets this body after fetching it from the
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#freeBodies"><code>World.freeBodies
</code></a> Pool.
</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/Body.html#resetMassData()">resetMassData
</a></strong>()
</code>
<div class="block">This resets the mass properties to the sum of the mass properties of the fixtures.
</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/Body.html#setActive(boolean)">setActive
</a></strong>(boolean
flag)
</code>
<div class="block">Set the active state of the body.
</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/Body.html#setAngularDamping(float)">setAngularDamping
</a></strong>(float
angularDamping)
</code>
<div class="block">Set the angular damping of the body.
</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/Body.html#setAngularVelocity(float)">setAngularVelocity
</a></strong>(float
omega)
</code>
<div class="block">Set the angular velocity.
</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/Body.html#setAwake(boolean)">setAwake
</a></strong>(boolean
flag)
</code>
<div class="block">Set the sleep state of the body.
</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/Body.html#setBullet(boolean)">setBullet
</a></strong>(boolean
flag)
</code>
<div class="block">Should this body be treated like a bullet for continuous collision detection?
</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/Body.html#setFixedRotation(boolean)">setFixedRotation
</a></strong>(boolean
flag)
</code>
<div class="block">Set this body to have fixed rotation.
</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/Body.html#setGravityScale(float)">setGravityScale
</a></strong>(float
scale)
</code>
<div class="block">Sets the gravity scale of the body
</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/Body.html#setLinearDamping(float)">setLinearDamping
</a></strong>(float
linearDamping)
</code>
<div class="block">Set the linear damping of the body.
</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/Body.html#setLinearVelocity(float, float)">setLinearVelocity
</a></strong>(float
vX,
float
vY)
</code>
<div class="block">Set the linear velocity of the center of mass.
</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/Body.html#setLinearVelocity(com.badlogic.gdx.math.Vector2)">setLinearVelocity
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> v)
</code>
<div class="block">Set the linear velocity of the center of mass.
</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/Body.html#setMassData(com.badlogic.gdx.physics.box2d.MassData)">setMassData
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/MassData.html" title="class in com.badlogic.gdx.physics.box2d">MassData
</a> data)
</code>
<div class="block">Set the mass properties to override the mass properties of the fixtures.
</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/Body.html#setSleepingAllowed(boolean)">setSleepingAllowed
</a></strong>(boolean
flag)
</code>
<div class="block">You can disable sleeping on this body.
</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/Body.html#setTransform(float, float, float)">setTransform
</a></strong>(float
x,
float
y,
float
angle)
</code>
<div class="block">Set the position of the body's origin and rotation.
</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/Body.html#setTransform(com.badlogic.gdx.math.Vector2, float)">setTransform
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> position,
float
angle)
</code>
<div class="block">Set the position of the body's origin and rotation.
</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/Body.html#setType(com.badlogic.gdx.physics.box2d.BodyDef.BodyType)">setType
</a></strong>(
<a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.BodyType.html" title="enum in com.badlogic.gdx.physics.box2d">BodyDef.BodyType
</a> type)
</code>
<div class="block">Set the type of this body.
</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/Body.html#setUserData(java.lang.Object)">setUserData
</a></strong>(java.lang.Object
userData)
</code>
<div class="block">Set the user data
</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="addr">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addr
</h4>
<pre>protected
long addr
</pre>
<div class="block">the address of the body
</div>
</li>
</ul>
<a name="joints">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>joints
</h4>
<pre>protected
<a href="../../../../../com/badlogic/gdx/utils/Array.html" title="class in com.badlogic.gdx.utils">Array
</a><<a href="../../../../../com/badlogic/gdx/physics/box2d/JointEdge.html" title="class in com.badlogic.gdx.physics.box2d">JointEdge
</a>> joints
</pre>
<div class="block">Joints of this body
</div>
</li>
</ul>
<a name="localPoint2">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>localPoint2
</h4>
<pre>public final
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localPoint2
</pre>
</li>
</ul>
<a name="localVector">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>localVector
</h4>
<pre>public final
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localVector
</pre>
</li>
</ul>
<a name="linVelWorld">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>linVelWorld
</h4>
<pre>public final
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> linVelWorld
</pre>
</li>
</ul>
<a name="linVelLoc">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>linVelLoc
</h4>
<pre>public final
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> linVelLoc
</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail
</h3>
<a name="Body(com.badlogic.gdx.physics.box2d.World, long)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Body
</h4>
<pre>protected
Body(
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html" title="class in com.badlogic.gdx.physics.box2d">World
</a> world,
long
addr)
</pre>
<div class="block">Constructs a new body with the given address
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>world
</code> - the world
</dd><dd><code>addr
</code> - the address
</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="reset(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset
</h4>
<pre>protected
void
reset(long
addr)
</pre>
<div class="block">Resets this body after fetching it from the
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html#freeBodies"><code>World.freeBodies
</code></a> Pool.
</div>
</li>
</ul>
<a name="createFixture(com.badlogic.gdx.physics.box2d.FixtureDef)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createFixture
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a> createFixture(
<a href="../../../../../com/badlogic/gdx/physics/box2d/FixtureDef.html" title="class in com.badlogic.gdx.physics.box2d">FixtureDef
</a> def)
</pre>
<div class="block">Creates a fixture and attach it to this body. Use this function if you need to set some fixture parameters, like friction.
Otherwise you can create the fixture directly from a shape. If the density is non-zero, this function automatically updates
the mass of the body. Contacts are not created until the next time step.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>def
</code> - the fixture definition.
</dd></dl>
</li>
</ul>
<a name="createFixture(com.badlogic.gdx.physics.box2d.Shape, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createFixture
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a> createFixture(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Shape.html" title="class in com.badlogic.gdx.physics.box2d">Shape
</a> shape,
float
density)
</pre>
<div class="block">Creates a fixture from a shape and attach it to this body. This is a convenience function. Use b2FixtureDef if you need to
set parameters like friction, restitution, user data, or filtering. If the density is non-zero, this function automatically
updates the mass of the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>shape
</code> - the shape to be cloned.
</dd><dd><code>density
</code> - the shape density (set to zero for static bodies).
</dd></dl>
</li>
</ul>
<a name="destroyFixture(com.badlogic.gdx.physics.box2d.Fixture)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroyFixture
</h4>
<pre>public
void
destroyFixture(
<a href="../../../../../com/badlogic/gdx/physics/box2d/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a> fixture)
</pre>
<div class="block">Destroy a fixture. This removes the fixture from the broad-phase and destroys all contacts associated with this fixture.
This will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density. All
fixtures attached to a body are implicitly destroyed when the body is destroyed.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>fixture
</code> - the fixture to be removed.
</dd></dl>
</li>
</ul>
<a name="setTransform(com.badlogic.gdx.math.Vector2, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTransform
</h4>
<pre>public
void
setTransform(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> position,
float
angle)
</pre>
<div class="block">Set the position of the body's origin and rotation. This breaks any contacts and wakes the other bodies. Manipulating a
body's transform may cause non-physical behavior.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>position
</code> - the world position of the body's local origin.
</dd><dd><code>angle
</code> - the world rotation in radians.
</dd></dl>
</li>
</ul>
<a name="setTransform(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTransform
</h4>
<pre>public
void
setTransform(float
x,
float
y,
float
angle)
</pre>
<div class="block">Set the position of the body's origin and rotation. This breaks any contacts and wakes the other bodies. Manipulating a
body's transform may cause non-physical behavior.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x
</code> - the world position on the x-axis
</dd><dd><code>y
</code> - the world position on the y-axis
</dd><dd><code>angle
</code> - the world rotation in radians.
</dd></dl>
</li>
</ul>
<a name="getTransform()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTransform
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/Transform.html" title="class in com.badlogic.gdx.physics.box2d">Transform
</a> getTransform()
</pre>
<div class="block">Get the body transform for the body's origin.
</div>
</li>
</ul>
<a name="getPosition()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPosition
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getPosition()
</pre>
<div class="block">Get the world body origin position.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the world position of the body's origin.
</dd></dl>
</li>
</ul>
<a name="getAngle()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAngle
</h4>
<pre>public
float
getAngle()
</pre>
<div class="block">Get the angle in radians.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the current world rotation angle in radians.
</dd></dl>
</li>
</ul>
<a name="getWorldCenter()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWorldCenter
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getWorldCenter()
</pre>
<div class="block">Get the world position of the center of mass.
</div>
</li>
</ul>
<a name="getLocalCenter()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocalCenter
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getLocalCenter()
</pre>
<div class="block">Get the local position of the center of mass.
</div>
</li>
</ul>
<a name="setLinearVelocity(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLinearVelocity
</h4>
<pre>public
void
setLinearVelocity(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> v)
</pre>
<div class="block">Set the linear velocity of the center of mass.
</div>
</li>
</ul>
<a name="setLinearVelocity(float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLinearVelocity
</h4>
<pre>public
void
setLinearVelocity(float
vX,
float
vY)
</pre>
<div class="block">Set the linear velocity of the center of mass.
</div>
</li>
</ul>
<a name="getLinearVelocity()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLinearVelocity
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getLinearVelocity()
</pre>
<div class="block">Get the linear velocity of the center of mass.
</div>
</li>
</ul>
<a name="setAngularVelocity(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAngularVelocity
</h4>
<pre>public
void
setAngularVelocity(float
omega)
</pre>
<div class="block">Set the angular velocity.
</div>
</li>
</ul>
<a name="getAngularVelocity()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAngularVelocity
</h4>
<pre>public
float
getAngularVelocity()
</pre>
<div class="block">Get the angular velocity.
</div>
</li>
</ul>
<a name="applyForce(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyForce
</h4>
<pre>public
void
applyForce(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> force,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point,
boolean
wake)
</pre>
<div class="block">Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the
angular velocity. This wakes up the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>force
</code> - the world force vector, usually in Newtons (N).
</dd><dd><code>point
</code> - the world position of the point of application.
</dd><dd><code>wake
</code> - up the body
</dd></dl>
</li>
</ul>
<a name="applyForce(float, float, float, float, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyForce
</h4>
<pre>public
void
applyForce(float
forceX,
float
forceY,
float
pointX,
float
pointY,
boolean
wake)
</pre>
<div class="block">Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the
angular velocity. This wakes up the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>forceX
</code> - the world force vector on x, usually in Newtons (N).
</dd><dd><code>forceY
</code> - the world force vector on y, usually in Newtons (N).
</dd><dd><code>pointX
</code> - the world position of the point of application on x.
</dd><dd><code>pointY
</code> - the world position of the point of application on y.
</dd><dd><code>wake
</code> - up the body
</dd></dl>
</li>
</ul>
<a name="applyForceToCenter(com.badlogic.gdx.math.Vector2, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyForceToCenter
</h4>
<pre>public
void
applyForceToCenter(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> force,
boolean
wake)
</pre>
<div class="block">Apply a force to the center of mass. This wakes up the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>force
</code> - the world force vector, usually in Newtons (N).
</dd></dl>
</li>
</ul>
<a name="applyForceToCenter(float, float, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyForceToCenter
</h4>
<pre>public
void
applyForceToCenter(float
forceX,
float
forceY,
boolean
wake)
</pre>
<div class="block">Apply a force to the center of mass. This wakes up the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>forceX
</code> - the world force vector, usually in Newtons (N).
</dd><dd><code>forceY
</code> - the world force vector, usually in Newtons (N).
</dd></dl>
</li>
</ul>
<a name="applyTorque(float, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyTorque
</h4>
<pre>public
void
applyTorque(float
torque,
boolean
wake)
</pre>
<div class="block">Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up
the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>torque
</code> - about the z-axis (out of the screen), usually in N-m.
</dd><dd><code>wake
</code> - up the body
</dd></dl>
</li>
</ul>
<a name="applyLinearImpulse(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyLinearImpulse
</h4>
<pre>public
void
applyLinearImpulse(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> impulse,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point,
boolean
wake)
</pre>
<div class="block">Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of
application is not at the center of mass. This wakes up the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>impulse
</code> - the world impulse vector, usually in N-seconds or kg-m/s.
</dd><dd><code>point
</code> - the world position of the point of application.
</dd><dd><code>wake
</code> - up the body
</dd></dl>
</li>
</ul>
<a name="applyLinearImpulse(float, float, float, float, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyLinearImpulse
</h4>
<pre>public
void
applyLinearImpulse(float
impulseX,
float
impulseY,
float
pointX,
float
pointY,
boolean
wake)
</pre>
<div class="block">Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of
application is not at the center of mass. This wakes up the body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>impulseX
</code> - the world impulse vector on the x-axis, usually in N-seconds or kg-m/s.
</dd><dd><code>impulseY
</code> - the world impulse vector on the y-axis, usually in N-seconds or kg-m/s.
</dd><dd><code>pointX
</code> - the world position of the point of application on the x-axis.
</dd><dd><code>pointY
</code> - the world position of the point of application on the y-axis.
</dd><dd><code>wake
</code> - up the body
</dd></dl>
</li>
</ul>
<a name="applyAngularImpulse(float, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyAngularImpulse
</h4>
<pre>public
void
applyAngularImpulse(float
impulse,
boolean
wake)
</pre>
<div class="block">Apply an angular impulse.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>impulse
</code> - the angular impulse in units of kg*m*m/s
</dd></dl>
</li>
</ul>
<a name="getMass()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMass
</h4>
<pre>public
float
getMass()
</pre>
<div class="block">Get the total mass of the body.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the mass, usually in kilograms (kg).
</dd></dl>
</li>
</ul>
<a name="getInertia()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInertia
</h4>
<pre>public
float
getInertia()
</pre>
<div class="block">Get the rotational inertia of the body about the local origin.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the rotational inertia, usually in kg-m^2.
</dd></dl>
</li>
</ul>
<a name="getMassData()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMassData
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/MassData.html" title="class in com.badlogic.gdx.physics.box2d">MassData
</a> getMassData()
</pre>
<div class="block">Get the mass data of the body.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>a struct containing the mass, inertia and center of the body.
</dd></dl>
</li>
</ul>
<a name="setMassData(com.badlogic.gdx.physics.box2d.MassData)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMassData
</h4>
<pre>public
void
setMassData(
<a href="../../../../../com/badlogic/gdx/physics/box2d/MassData.html" title="class in com.badlogic.gdx.physics.box2d">MassData
</a> data)
</pre>
<div class="block">Set the mass properties to override the mass properties of the fixtures. Note that this changes the center of mass position.
Note that creating or destroying fixtures can also alter the mass. This function has no effect if the body isn't dynamic.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>data
</code> - the mass properties.
</dd></dl>
</li>
</ul>
<a name="resetMassData()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resetMassData
</h4>
<pre>public
void
resetMassData()
</pre>
<div class="block">This resets the mass properties to the sum of the mass properties of the fixtures. This normally does not need to be called
unless you called SetMassData to override the mass and you later want to reset the mass.
</div>
</li>
</ul>
<a name="getWorldPoint(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWorldPoint
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getWorldPoint(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localPoint)
</pre>
<div class="block">Get the world coordinates of a point given the local coordinates.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>localPoint
</code> - a point on the body measured relative the the body's origin.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the same point expressed in world coordinates.
</dd></dl>
</li>
</ul>
<a name="getWorldVector(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWorldVector
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getWorldVector(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localVector)
</pre>
<div class="block">Get the world coordinates of a vector given the local coordinates.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>localVector
</code> - a vector fixed in the body.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the same vector expressed in world coordinates.
</dd></dl>
</li>
</ul>
<a name="getLocalPoint(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocalPoint
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getLocalPoint(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> worldPoint)
</pre>
<div class="block">Gets a local point relative to the body's origin given a world point.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>worldPoint
</code> - a point in world coordinates.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the corresponding local point relative to the body's origin.
</dd></dl>
</li>
</ul>
<a name="getLocalVector(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocalVector
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getLocalVector(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> worldVector)
</pre>
<div class="block">Gets a local vector given a world vector.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>worldVector
</code> - a vector in world coordinates.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the corresponding local vector.
</dd></dl>
</li>
</ul>
<a name="getLinearVelocityFromWorldPoint(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLinearVelocityFromWorldPoint
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getLinearVelocityFromWorldPoint(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> worldPoint)
</pre>
<div class="block">Get the world linear velocity of a world point attached to this body.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>worldPoint
</code> - a point in world coordinates.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the world velocity of a point.
</dd></dl>
</li>
</ul>
<a name="getLinearVelocityFromLocalPoint(com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLinearVelocityFromLocalPoint
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> getLinearVelocityFromLocalPoint(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> localPoint)
</pre>
<div class="block">Get the world velocity of a local point.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>localPoint
</code> - a point in local coordinates.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the world velocity of a point.
</dd></dl>
</li>
</ul>
<a name="getLinearDamping()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLinearDamping
</h4>
<pre>public
float
getLinearDamping()
</pre>
<div class="block">Get the linear damping of the body.
</div>
</li>
</ul>
<a name="setLinearDamping(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLinearDamping
</h4>
<pre>public
void
setLinearDamping(float
linearDamping)
</pre>
<div class="block">Set the linear damping of the body.
</div>
</li>
</ul>
<a name="getAngularDamping()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAngularDamping
</h4>
<pre>public
float
getAngularDamping()
</pre>
<div class="block">Get the angular damping of the body.
</div>
</li>
</ul>
<a name="setAngularDamping(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAngularDamping
</h4>
<pre>public
void
setAngularDamping(float
angularDamping)
</pre>
<div class="block">Set the angular damping of the body.
</div>
</li>
</ul>
<a name="setType(com.badlogic.gdx.physics.box2d.BodyDef.BodyType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setType
</h4>
<pre>public
void
setType(
<a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.BodyType.html" title="enum in com.badlogic.gdx.physics.box2d">BodyDef.BodyType
</a> type)
</pre>
<div class="block">Set the type of this body. This may alter the mass and velocity.
</div>
</li>
</ul>
<a name="getType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getType
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.BodyType.html" title="enum in com.badlogic.gdx.physics.box2d">BodyDef.BodyType
</a> getType()
</pre>
<div class="block">Get the type of this body.
</div>
</li>
</ul>
<a name="setBullet(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBullet
</h4>
<pre>public
void
setBullet(boolean
flag)
</pre>
<div class="block">Should this body be treated like a bullet for continuous collision detection?
</div>
</li>
</ul>
<a name="isBullet()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isBullet
</h4>
<pre>public
boolean
isBullet()
</pre>
<div class="block">Is this body treated like a bullet for continuous collision detection?
</div>
</li>
</ul>
<a name="setSleepingAllowed(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSleepingAllowed
</h4>
<pre>public
void
setSleepingAllowed(boolean
flag)
</pre>
<div class="block">You can disable sleeping on this body. If you disable sleeping, the
</div>
</li>
</ul>
<a name="isSleepingAllowed()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSleepingAllowed
</h4>
<pre>public
boolean
isSleepingAllowed()
</pre>
<div class="block">Is this body allowed to sleep
</div>
</li>
</ul>
<a name="setAwake(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAwake
</h4>
<pre>public
void
setAwake(boolean
flag)
</pre>
<div class="block">Set the sleep state of the body. A sleeping body has very low CPU cost.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>flag
</code> - set to true to put body to sleep, false to wake it.
</dd></dl>
</li>
</ul>
<a name="isAwake()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAwake
</h4>
<pre>public
boolean
isAwake()
</pre>
<div class="block">Get the sleeping state of this body.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>true if the body is sleeping.
</dd></dl>
</li>
</ul>
<a name="setActive(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setActive
</h4>
<pre>public
void
setActive(boolean
flag)
</pre>
<div class="block">Set the active state of the body. An inactive body is not simulated and cannot be collided with or woken up. If you pass a
flag of true, all fixtures will be added to the broad-phase. If you pass a flag of false, all fixtures will be removed from
the broad-phase and all contacts will be destroyed. Fixtures and joints are otherwise unaffected. You may continue to
create/destroy fixtures and joints on inactive bodies. Fixtures on an inactive body are implicitly inactive and will not
participate in collisions, ray-casts, or queries. Joints connected to an inactive body are implicitly inactive. An inactive
body is still owned by a b2World object and remains in the body list.
</div>
</li>
</ul>
<a name="isActive()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isActive
</h4>
<pre>public
boolean
isActive()
</pre>
<div class="block">Get the active state of the body.
</div>
</li>
</ul>
<a name="setFixedRotation(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setFixedRotation
</h4>
<pre>public
void
setFixedRotation(boolean
flag)
</pre>
<div class="block">Set this body to have fixed rotation. This causes the mass to be reset.
</div>
</li>
</ul>
<a name="isFixedRotation()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isFixedRotation
</h4>
<pre>public
boolean
isFixedRotation()
</pre>
<div class="block">Does this body have fixed rotation?
</div>
</li>
</ul>
<a name="getFixtureList()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFixtureList
</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/Fixture.html" title="class in com.badlogic.gdx.physics.box2d">Fixture
</a>> getFixtureList()
</pre>
<div class="block">Get the list of all fixtures attached to this body. Do not modify the list!
</div>
</li>
</ul>
<a name="getJointList()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJointList
</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/JointEdge.html" title="class in com.badlogic.gdx.physics.box2d">JointEdge
</a>> getJointList()
</pre>
<div class="block">Get the list of all joints attached to this body. Do not modify the list!
</div>
</li>
</ul>
<a name="getGravityScale()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGravityScale
</h4>
<pre>public
float
getGravityScale()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>Get the gravity scale of the body.
</dd></dl>
</li>
</ul>
<a name="setGravityScale(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setGravityScale
</h4>
<pre>public
void
setGravityScale(float
scale)
</pre>
<div class="block">Sets the gravity scale of the body
</div>
</li>
</ul>
<a name="getWorld()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWorld
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/physics/box2d/World.html" title="class in com.badlogic.gdx.physics.box2d">World
</a> getWorld()
</pre>
<div class="block">Get the parent world of this body.
</div>
</li>
</ul>
<a name="getUserData()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserData
</h4>
<pre>public
java.lang.Object
getUserData()
</pre>
<div class="block">Get the user data
</div>
</li>
</ul>
<a name="setUserData(java.lang.Object)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setUserData
</h4>
<pre>public
void
setUserData(java.lang.Object
userData)
</pre>
<div class="block">Set the user data
</div>
</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/Body.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>Prev Class
</li>
<li><a href="../../../../../com/badlogic/gdx/physics/box2d/BodyDef.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/Body.html" target="_top">Frames
</a></li>
<li><a href="Body.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>