<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DevNote.org</title>
	<atom:link href="http://www.devnote.org/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.devnote.org/wordpress</link>
	<description>a software development resource</description>
	<lastBuildDate>Sat, 19 Sep 2009 06:33:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Port Box2D To iPhone and iPod Touch</title>
		<link>http://www.devnote.org/wordpress/?p=24</link>
		<comments>http://www.devnote.org/wordpress/?p=24#comments</comments>
		<pubDate>Sun, 05 Apr 2009 01:26:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Box2D]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.devnote.org/wordpress/?p=24</guid>
		<description><![CDATA[Box2D physics engine for developing iPhone apps (reliable resource):
http://www.handcircus.com/2009/01/15/iphone-port-of-box2d-testbed-now-available/
or skip to checking out the code via svn:
https://box2d.svn.sourceforge.net/svnroot/box2d/
If you arrived here to find your answer with difficulty because you were using different search than those associated with this article, please contribute to the below list via comment.
how do i use box2d in my iphone apps? porting [...]]]></description>
			<content:encoded><![CDATA[<p>Box2D physics engine for developing iPhone apps (reliable resource):</p>
<p><a href="http://www.handcircus.com/2009/01/15/iphone-port-of-box2d-testbed-now-available/">http://www.handcircus.com/2009/01/15/iphone-port-of-box2d-testbed-now-available/</a></p>
<p>or skip to checking out the code via svn:</p>
<p><a href="https://box2d.svn.sourceforge.net/svnroot/box2d/">https://box2d.svn.sourceforge.net/svnroot/box2d/</a></p>
<p>If you arrived here to find your answer with difficulty because you were using different search than those associated with this article, please contribute to the below list via comment.</p>
<p>how do i use box2d in my iphone apps? porting the box2d engine to iphone and ipod touch games. what do i need to do to use box2d in my iphone app? box2d to iphone/ipod touch port.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devnote.org/wordpress/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding an isGravitated Attribute to Box2D Bodies</title>
		<link>http://www.devnote.org/wordpress/?p=14</link>
		<comments>http://www.devnote.org/wordpress/?p=14#comments</comments>
		<pubDate>Sun, 05 Apr 2009 00:20:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Box2D]]></category>

		<guid isPermaLink="false">http://www.devnote.org/wordpress/?p=14</guid>
		<description><![CDATA[For turning off the effects of gravity on some bodies while not on others, this tutorial covers the necessary steps to add an &#8220;isGravitated&#8221; property to the b2BodyDef struct.
The result:
// turn off gravity
bodyDef.isGravitated = false;
The steps (16):
1)  Locate &#8220;b2Body.h&#8221; file (found in the &#8220;Source/Dynamics&#8221; folder).
2)  Locate the following code (try  Ctrl+F  or  Command+F  for this [...]]]></description>
			<content:encoded><![CDATA[<p>For turning off the effects of gravity on some bodies while not on others, this tutorial covers the necessary steps to add an &#8220;isGravitated&#8221; property to the b2BodyDef struct.</p>
<p>The result:</p>
<p>// turn off gravity<br />
bodyDef.isGravitated = false;</p>
<p>The steps (16):</p>
<p><strong>1)  Locate &#8220;b2Body.h&#8221; file (found in the &#8220;Source/Dynamics&#8221; folder).</strong></p>
<p><strong>2)  Locate the following code (try  Ctrl+F  or  Command+F  for this step):</strong></p>
<p>bool isBullet;</p>
<p><strong>3)  Just below the above line of code, add a new variable:</strong></p>
<p>bool isGravitated;</p>
<p><strong>4)  Locate the following code (towards the top of the file):</strong></p>
<p>b2BodyDef()<br />
{<br />
massData.center.SetZero();<br />
massData.mass = 0.0f;<br />
massData.I = 0.0f;<br />
userData = NULL;<br />
position.Set(0.0f, 0.0f);<br />
angle = 0.0f;<br />
linearDamping = 0.0f;<br />
angularDamping = 0.0f;<br />
allowSleep = true;<br />
isSleeping = false;<br />
fixedRotation = false;<br />
isBullet = false;<br />
}</p>
<p><strong>5)  In the b2BodyDef constructor (i.e. the above code), add a default value for isGravitated:</strong></p>
<p>isGravitated = true;</p>
<p><strong>6)  Also in the b2Body.h file, locate the following code:</strong></p>
<p>enum<br />
{<br />
e_frozenFlag = 0&#215;0002,<br />
e_islandFlag = 0&#215;0004,<br />
e_sleepFlag = 0&#215;0008,<br />
e_allowSleepFlag = 0&#215;0010,<br />
e_bulletFlag = 0&#215;0020,<br />
e_fixedRotationFlag = 0&#215;0040,<br />
}</p>
<p><strong>7)  Add a value just below &#8220;e_fixedRotationFlag&#8221; to represent our new &#8220;IsGravitated&#8221; attribute:</strong></p>
<p>e_gravitatedFlag = 0&#215;0200,</p>
<p><strong>8)  Also in the b2Body.h file, locate the following code:</strong></p>
<p>/// Is this body treated like a bullet for continuous collision detection?<br />
bool IsBullet() const;</p>
<p><strong>9)  Just below the &#8220;IsBullet()&#8221; function declaration, declare our &#8220;IsGravitated()&#8221; function by adding:</strong></p>
<p>/// Is this body affected by gravity?<br />
bool IsGravitated() const;</p>
<p><strong>10)  Still in the b2Body.h file, locate the following code:</strong></p>
<p>inline bool b2Body::IsBullet() const</p>
<p><strong>11)  Just above the line of code (the placement is merely for organizational purposes), add the following code:</strong></p>
<p>inline bool b2Body::IsGravitated() const<br />
{<br />
return (m_flags &amp; e_gravitatedFlag) == e_gravitatedFlag;<br />
}</p>
<p><strong>12)  Locate the b2Island.cpp file (also found in the &#8220;Source/Dynamics&#8221; folder).</strong></p>
<p><strong>13)  In the b2Island.cpp file, find the following line of code:</strong></p>
<p>b-&gt;m_linearVelocity += step.dt * (gravity + b-&gt;m_invMass * b-&gt;m_force);</p>
<p><strong>14)  Separation application of gravity and applied forces, and add an &#8220;if&#8221; condition to test for the &#8220;isGravitated&#8221; property so the code now looks like (i.e. replace the above line of code with the following):</strong></p>
<p>if (b-&gt;IsGravitated())<br />
{<br />
b-&gt;m_linearVelocity += step.dt * gravity;<br />
}<br />
b-&gt;m_linearVelocity += step.dt * (b-&gt;m_invMass * b-&gt;m_force);</p>
<p><strong>15)  Finally, in the b2Body.cpp file, locate the following code:</strong></p>
<p>if (bd-&gt;isBullet)<br />
{<br />
m_flags |= e_bulletFlag;<br />
}</p>
<p><strong>16)  Just below the above code, add the following:</strong></p>
<p>if (bd-&gt;isGravitated)<br />
{<br />
m_flags |= e_gravitatedFlag;<br />
}</p>
<p><strong>All 16 steps complete.</strong></p>
<p>If you arrived here to find your answer with difficulty because you were using different search terms than those associated with this article, please contribute to the below list via comment.</p>
<p>how do i turn off gravity for box2d? in box2d, how do i turn off gravity for some objects and not others? can i make my box2d objects not fall? how do i implement a bullet or projectile that&#8217;s not affected by gravity? i want some b2body instances to fall and others to not fall.  can i adjust the b2bodydef struct to accommodate the toggling of gravity? nullifying gravity for some objects in box2d.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devnote.org/wordpress/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>DevNote.org Launched</title>
		<link>http://www.devnote.org/wordpress/?p=7</link>
		<comments>http://www.devnote.org/wordpress/?p=7#comments</comments>
		<pubDate>Sat, 04 Apr 2009 23:29:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DevNote.org]]></category>

		<guid isPermaLink="false">http://www.devnote.org/wordpress/?p=7</guid>
		<description><![CDATA[DevNote.org is a software developer resource.  In particular, DevNote.org presents documentation, tutorials, examples, and notes concerning the development of software.  The presentation aims to be succinct and informative.
]]></description>
			<content:encoded><![CDATA[<p>DevNote.org is a software developer resource.  In particular, DevNote.org presents documentation, tutorials, examples, and notes concerning the development of software.  The presentation aims to be succinct and informative.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devnote.org/wordpress/?feed=rss2&amp;p=7</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
