<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Collision Detection Methods</title>
	<atom:link href="http://www.71squared.com/2010/03/collision-detection-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.71squared.com/2010/03/collision-detection-methods/</link>
	<description>iPhone Game Development - Web Development</description>
	<lastBuildDate>Sat, 04 Feb 2012 20:13:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Chris</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-2/#comment-5660</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 16 Feb 2011 12:07:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-5660</guid>
		<description>Hey again!

Couldn´t find a reply button... so I hope it´s okay that I send a new comment instead.

can I combine Box2D and Chipmunk with the code I already have created to get the collision detection to work the way I want it to work or do I need to rewrite the whole game (menu,settings etc). (isn´t there any other way to do this?) I feels like I don´t have time to learn how chipmunk or box2d works. I´m closing in on the deadline :(</description>
		<content:encoded><![CDATA[<p>Hey again!</p>
<p>Couldn´t find a reply button&#8230; so I hope it´s okay that I send a new comment instead.</p>
<p>can I combine Box2D and Chipmunk with the code I already have created to get the collision detection to work the way I want it to work or do I need to rewrite the whole game (menu,settings etc). (isn´t there any other way to do this?) I feels like I don´t have time to learn how chipmunk or box2d works. I´m closing in on the deadline :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-2/#comment-5612</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Mon, 14 Feb 2011 10:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-5612</guid>
		<description>Hi Chris

There is no reason why these methods could not be used for that although your needs do introduce a few more complexities.

The methods as they stand just let you know when two objects intersect each other, they don&#039;t tell you by how much the objects penetrate each other. This is important so that having identified a collision, how far back you need to move the objects so they are touching but not penetrating.

This can get complex quickly and I would suggest using a physics engine such as Box2D or Chipmunk. These can be used in an app that doesn&#039;t use OpenGL. You would simply set up your physics world in which you create objects of the size of your UIImages. Then you step the world each game update and use the location and rotation of the object in the physics world to set the location and rotation of the UIImage before you render it.

Doing this will give you all the collision detection and resting functionality you need plus more.

It sounds complex, but once you start looking into it it&#039;s not too bad.

Mike</description>
		<content:encoded><![CDATA[<p>Hi Chris</p>
<p>There is no reason why these methods could not be used for that although your needs do introduce a few more complexities.</p>
<p>The methods as they stand just let you know when two objects intersect each other, they don&#8217;t tell you by how much the objects penetrate each other. This is important so that having identified a collision, how far back you need to move the objects so they are touching but not penetrating.</p>
<p>This can get complex quickly and I would suggest using a physics engine such as Box2D or Chipmunk. These can be used in an app that doesn&#8217;t use OpenGL. You would simply set up your physics world in which you create objects of the size of your UIImages. Then you step the world each game update and use the location and rotation of the object in the physics world to set the location and rotation of the UIImage before you render it.</p>
<p>Doing this will give you all the collision detection and resting functionality you need plus more.</p>
<p>It sounds complex, but once you start looking into it it&#8217;s not too bad.</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-2/#comment-5611</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 14 Feb 2011 10:16:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-5611</guid>
		<description>Can these methods be used as well if there is a rectangle-rectangle collision detection?

I´m trying to create &quot;solid&quot; rectangles for a game (without using OPENGL, just regular UIIMAGES) where the rectangles cannot go through each other (when trying you should feel like hitting a wall) but can be stacked on top of each other.

any tutorial about that type of collision detection?</description>
		<content:encoded><![CDATA[<p>Can these methods be used as well if there is a rectangle-rectangle collision detection?</p>
<p>I´m trying to create &#8220;solid&#8221; rectangles for a game (without using OPENGL, just regular UIIMAGES) where the rectangles cannot go through each other (when trying you should feel like hitting a wall) but can be stacked on top of each other.</p>
<p>any tutorial about that type of collision detection?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paulw</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-2/#comment-3765</link>
		<dc:creator>Paulw</dc:creator>
		<pubDate>Mon, 26 Jul 2010 18:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-3765</guid>
		<description>Hi Mike
just a quick comment to say how much I am enjoying your videos and comments. I am looking forward to your book and am going to buy it on day one.
Keep up the good work.

Paul</description>
		<content:encoded><![CDATA[<p>Hi Mike<br />
just a quick comment to say how much I am enjoying your videos and comments. I am looking forward to your book and am going to buy it on day one.<br />
Keep up the good work.</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention Collision Detection Methods &#124; 71² - The ramblings of two 30-something developers -- Topsy.com</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-2/#comment-3145</link>
		<dc:creator>Tweets that mention Collision Detection Methods &#124; 71² - The ramblings of two 30-something developers -- Topsy.com</dc:creator>
		<pubDate>Mon, 19 Apr 2010 08:58:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-3145</guid>
		<description>[...] This post was mentioned on Twitter by AQILITY. AQILITY said: On Collision Detection Methods- http://bit.ly/dA8iYX [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by AQILITY. AQILITY said: On Collision Detection Methods- <a href="http://bit.ly/dA8iYX" rel="nofollow">http://bit.ly/dA8iYX</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Person</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-2/#comment-3018</link>
		<dc:creator>A Person</dc:creator>
		<pubDate>Sat, 03 Apr 2010 22:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-3018</guid>
		<description>Any ideas on how the rectangle circle collision detection could be changed to work for oriented rectangles?</description>
		<content:encoded><![CDATA[<p>Any ideas on how the rectangle circle collision detection could be changed to work for oriented rectangles?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: blakeman13</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-2/#comment-2865</link>
		<dc:creator>blakeman13</dc:creator>
		<pubDate>Tue, 09 Mar 2010 23:23:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-2865</guid>
		<description>So how would this work for like a entity such as the ghost in your tutorials and how would you remove it from the screen if a collision is detected and or introduce an explosion where the collision was detected</description>
		<content:encoded><![CDATA[<p>So how would this work for like a entity such as the ghost in your tutorials and how would you remove it from the screen if a collision is detected and or introduce an explosion where the collision was detected</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-1/#comment-2844</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Mon, 08 Mar 2010 16:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-2844</guid>
		<description>A Person,

My OBB system is pretty basic.  First of all, all my static collision boundaries on my map are created using AABB (normalized rectangles).  All of my entities including my player are done with “forward moving” OBB.  Basically the bounding box around all my entities is rotated in the same direction the entity is facing.  I created a simple structure to hold the OBB called RotatedQuad like this:

Typedef struct {
CGPoint frontLeft;
CGPoint frontRight;
CGPoint rearRight;
CGPoint rearLeft;
} RotatedQuad;

Each entity is responsible for keeping its bounding box rotated in the correct orientation.  Once I need to check for a collision, I simply just check to see if the frontLeft and/or frontRight CGPoints are within any of my static bounds.  The actual collision testing is really as simple as AABB testing.  Since I am only concerned with the front of each bounding box, it makes it even simpler.

To speed this up, I pre process my map on startup to save every tile location in the map to a 2D array called walkabilityArray.  This array is indexed using the x and y coords of the map location.  During initialization, if I find a static boundary passes anywhere within the tile, I save a value of 0 indicating that there is a boundary on the tile and further testing should be performed.  If no boundary is present on the tile, I save a 1 indicating that there is nothing to check and to move on.

This really helps performance when doing collision checking.  Instead of constantly checking each quad and static boundary for a collision, I first just perform a lookup in my walkabilityArray to see if I really need to do any kind of collision test.  Accessing my 2D array is much faster than checking for OBB vs. AABB collisions.

I hope this helps, but if you are looking for more specifics, just let me know.

-Scott</description>
		<content:encoded><![CDATA[<p>A Person,</p>
<p>My OBB system is pretty basic.  First of all, all my static collision boundaries on my map are created using AABB (normalized rectangles).  All of my entities including my player are done with “forward moving” OBB.  Basically the bounding box around all my entities is rotated in the same direction the entity is facing.  I created a simple structure to hold the OBB called RotatedQuad like this:</p>
<p>Typedef struct {<br />
CGPoint frontLeft;<br />
CGPoint frontRight;<br />
CGPoint rearRight;<br />
CGPoint rearLeft;<br />
} RotatedQuad;</p>
<p>Each entity is responsible for keeping its bounding box rotated in the correct orientation.  Once I need to check for a collision, I simply just check to see if the frontLeft and/or frontRight CGPoints are within any of my static bounds.  The actual collision testing is really as simple as AABB testing.  Since I am only concerned with the front of each bounding box, it makes it even simpler.</p>
<p>To speed this up, I pre process my map on startup to save every tile location in the map to a 2D array called walkabilityArray.  This array is indexed using the x and y coords of the map location.  During initialization, if I find a static boundary passes anywhere within the tile, I save a value of 0 indicating that there is a boundary on the tile and further testing should be performed.  If no boundary is present on the tile, I save a 1 indicating that there is nothing to check and to move on.</p>
<p>This really helps performance when doing collision checking.  Instead of constantly checking each quad and static boundary for a collision, I first just perform a lookup in my walkabilityArray to see if I really need to do any kind of collision test.  Accessing my 2D array is much faster than checking for OBB vs. AABB collisions.</p>
<p>I hope this helps, but if you are looking for more specifics, just let me know.</p>
<p>-Scott</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Easy And Accurate 2D Collisions &#124; iPhone and iPad SDK Development Tutorials and Programming Tips</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-1/#comment-2843</link>
		<dc:creator>Easy And Accurate 2D Collisions &#124; iPhone and iPad SDK Development Tutorials and Programming Tips</dc:creator>
		<pubDate>Mon, 08 Mar 2010 10:49:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-2843</guid>
		<description>[...] first tutorial is from 71 Squared on Collision Detection Methods which has a some nice straightforward functions written in C that you can drop into your code for [...]</description>
		<content:encoded><![CDATA[<p>[...] first tutorial is from 71 Squared on Collision Detection Methods which has a some nice straightforward functions written in C that you can drop into your code for [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Person</title>
		<link>http://www.71squared.com/2010/03/collision-detection-methods/comment-page-1/#comment-2842</link>
		<dc:creator>A Person</dc:creator>
		<pubDate>Mon, 08 Mar 2010 02:30:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.com/?p=1197#comment-2842</guid>
		<description>@Scott

What method of OBB collision detection did you use?  I am working on a OBB collision detection system of mine own i&#039;d love to know how you implemented yours.</description>
		<content:encoded><![CDATA[<p>@Scott</p>
<p>What method of OBB collision detection did you use?  I am working on a OBB collision detection system of mine own i&#8217;d love to know how you implemented yours.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

