<?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>Freya.no &#187; cpp</title>
	<atom:link href="http://wp.freya.no/tag/cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.freya.no</link>
	<description>Knowledge is power</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:56:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple AABB vs AABB collision detection</title>
		<link>http://wp.freya.no/3d-math-and-physics/simple-aabb-vs-aabb-collision-detection/</link>
		<comments>http://wp.freya.no/3d-math-and-physics/simple-aabb-vs-aabb-collision-detection/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 21:13:02 +0000</pubDate>
		<dc:creator>kent</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AABB]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://wp.freya.no/</guid>
		<description><![CDATA[An AABB is an axis aligned bounding box. It&#8217;s mainly used in broadphase physics detection. Assume this are the basic properties of an AABB. Then we can use this simple test to check if there is an overlap between the bounding boxes. No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>An AABB is an axis aligned bounding box. It&#8217;s mainly used in broadphase physics detection.</p>
<p>Assume this are the basic properties of an AABB.</p>
<pre class="brush: cpp; title: ; notranslate">
struct AABB
{
	Point c;		// center point
	float r[3];	// halfwidths
};
</pre>
<p>Then we can use this simple test to check if there is an overlap between the bounding boxes.</p>
<pre class="brush: cpp; title: ; notranslate">
bool testAABBAABB(const AABB &amp;a, const AABB &amp;b)
{
	float t;
	if ( Abs(a.c[0] - b.c[0]) &gt; (a.r[0] + b.r[0]) return false;
	if ( Abs(a.c[1] - b.c[1]) &gt; (a.r[1] + b.r[1]) return false;
	if ( Abs(a.c[2] - b.c[2]) &gt; (a.r[2] + b.r[2]) return false;
	// We have an overlap
	return true;
};
</pre>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=627" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F3d-math-and-physics%2Fsimple-aabb-vs-aabb-collision-detection%2F&amp;title=Simple%20AABB%20vs%20AABB%20collision%20detection" id="wpa2a_6"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/3d-math-and-physics/simple-aabb-vs-aabb-collision-detection/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

