<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Topic: Get the width of a cpBody</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/4589</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 01:54:48 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/topic/4589" rel="self" type="application/rss+xml" />

		<item>
			<title>mobilebros on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27500</link>
			<pubDate>Sun, 21 Feb 2010 06:10:13 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">27500@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Just skimming that article you posted, it'd be easy enough to change the code to use shapes instead of bodies. </p>
<p>The documentation on the google code page as well as looking at the definition of the structs is all I used for learning.
</p></description>
		</item>
		<item>
			<title>gowreck on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27494</link>
			<pubDate>Sun, 21 Feb 2010 05:03:36 +0000</pubDate>
			<dc:creator>gowreck</dc:creator>
			<guid isPermaLink="false">27494@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I really like the physics model actually.  I hacked my way through the <a href="http://morethanmachine.com/macdev/?tag=cocos2d" rel="nofollow">http://morethanmachine.com/macdev/?tag=cocos2d</a> and he creates a series of bullet objects that are only aware of the body.  At least...as far as I can tell... </p>
<p>I just wanted to be able to use the w, h as well for checking to see if things were heading offstage.</p>
<p>yawn...excuse my ramblings...
</p></description>
		</item>
		<item>
			<title>crmagicxxx on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27409</link>
			<pubDate>Sat, 20 Feb 2010 14:41:46 +0000</pubDate>
			<dc:creator>crmagicxxx</dc:creator>
			<guid isPermaLink="false">27409@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey, although tip for using body-&#62;data is OK, it's really not something you should do. Shape already has reference to a body, so why would you cross-reference your body to a shape again? Every chipmunk function that browse through the elements of the simulation, always does it with shapes, e.g. cpSpaceHashEach(space-&#62;activeShapes, ....)</p>
<p>So, better look for examples and read documentation. You'll get better understanding of the whole physics simulation model...
</p></description>
		</item>
		<item>
			<title>gowreck on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27406</link>
			<pubDate>Sat, 20 Feb 2010 14:26:33 +0000</pubDate>
			<dc:creator>gowreck</dc:creator>
			<guid isPermaLink="false">27406@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>That's perfect, thanks for your help.</p>
<p>I do have a question on where you figured that out?  Is there better documentation out there somewhere?</p>
<p>Anyways, I wish I could tip both of you for your help!
</p></description>
		</item>
		<item>
			<title>mobilebros on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27329</link>
			<pubDate>Fri, 19 Feb 2010 18:19:25 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">27329@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>you could do this to store the shape in the body:</p>
<pre><code>body-&#62;data = shape;</code></pre>
<p>and then retrieve it like this:</p>
<pre><code>cpShape* shape = (cpShape*)body-&#62;data;</code></pre></description>
		</item>
		<item>
			<title>crmagicxxx on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27327</link>
			<pubDate>Fri, 19 Feb 2010 17:21:51 +0000</pubDate>
			<dc:creator>crmagicxxx</dc:creator>
			<guid isPermaLink="false">27327@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Actually you're attaching a body to a shape. So shape has reference to a body. I was little unclear on that in first post... </p>
<p>So everything about ChipMunk simulation is on shapes doing this and doing that. Bodies are only giving physical properties to the shapes, like mass, moment, etc...</p>
<p>Check ChipMunk documentation for more info:<br />
<a href="http://code.google.com/p/chipmunk-physics/wiki/Documentation?tm=6" rel="nofollow">http://code.google.com/p/chipmunk-physics/wiki/Documentation?tm=6</a>
</p></description>
		</item>
		<item>
			<title>gowreck on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27326</link>
			<pubDate>Fri, 19 Feb 2010 17:18:19 +0000</pubDate>
			<dc:creator>gowreck</dc:creator>
			<guid isPermaLink="false">27326@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>That's about what I figured.  I think I've coded myself into a hole.  </p>
<p>Any way to get the attached shape from the cpbody?
</p></description>
		</item>
		<item>
			<title>crmagicxxx on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27323</link>
			<pubDate>Fri, 19 Feb 2010 17:08:01 +0000</pubDate>
			<dc:creator>crmagicxxx</dc:creator>
			<guid isPermaLink="false">27323@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>cpBody doesn't have width... Only shapes attached to it may have similar properties...
</p></description>
		</item>
		<item>
			<title>gowreck on "Get the width of a cpBody"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4589#post-27322</link>
			<pubDate>Fri, 19 Feb 2010 17:02:23 +0000</pubDate>
			<dc:creator>gowreck</dc:creator>
			<guid isPermaLink="false">27322@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is getting the width of a cpBody possible?  I'm tearing out my hair trying to figure this out.
</p></description>
		</item>

	</channel>
</rss>

