<?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: Strategies for optimizing collision detection with BitmapData.hitTest</title>
	<atom:link href="http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/</link>
	<description>code = joy</description>
	<lastBuildDate>Thu, 11 Mar 2010 21:22:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 7 interessante sommerartikler &#183; omFlash();</title>
		<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/comment-page-1/#comment-16557</link>
		<dc:creator>7 interessante sommerartikler &#183; omFlash();</dc:creator>
		<pubDate>Mon, 27 Jul 2009 09:45:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1754#comment-16557</guid>
		<description>[...] Strategies for optimizing collision detection with BitmapData.hitTest Overskriften siger det hele og der kan virkelig være meget performance at hente her! [...]</description>
		<content:encoded><![CDATA[<p>[...] Strategies for optimizing collision detection with BitmapData.hitTest Overskriften siger det hele og der kan virkelig være meget performance at hente her! [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: evden eve</title>
		<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/comment-page-1/#comment-16535</link>
		<dc:creator>evden eve</dc:creator>
		<pubDate>Sat, 18 Jul 2009 14:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1754#comment-16535</guid>
		<description>hi yet a working swf</description>
		<content:encoded><![CDATA[<p>hi yet a working swf</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Relative performance for collision detection techniques in ActionScript 3 at Mike Chambers</title>
		<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/comment-page-1/#comment-16446</link>
		<dc:creator>Relative performance for collision detection techniques in ActionScript 3 at Mike Chambers</dc:creator>
		<pubDate>Fri, 26 Jun 2009 22:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1754#comment-16446</guid>
		<description>[...] you have read my blog any this week, you have probably noticed that I have been doing some basic research on collision detection within [...]</description>
		<content:encoded><![CDATA[<p>[...] you have read my blog any this week, you have probably noticed that I have been doing some basic research on collision detection within [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bart van de Garde</title>
		<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/comment-page-1/#comment-16441</link>
		<dc:creator>Bart van de Garde</dc:creator>
		<pubDate>Fri, 26 Jun 2009 06:22:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1754#comment-16441</guid>
		<description>Excellent tips and tricks here. I recently implemented a sidescrolling choplifter-like game where we used bitmap collision and where performance got too low at first. The bitmap collision tests were eating all performance because there were a lot of enemies/objects etc. 

Unfortunately I couldn&#039;t get enough performance with the hitTest method on BitmapData so I implemented my own bitmap collision test method. The essential thing I added was a resolution parameter. E.g. if this parameter is 2 the collision test would only check every 2 pixels for collision. I ended up using a resolution of 3 which was very accurate, at least I didn&#039;t see any difference, and this did give a lot of extra performance (the performance is increased by resolution*resolution because it is regarded in horizontal and vertical direction).

For things like projectiles that are very small I used an other strategy because with the resolution the collision could miss while it was there. Those objects were regarded as simple point objects and only checked at one coordinate. This was implemented as a test at first and proved to be accurate enough for those objects because they were fast moving.

Implementing the bitmap collision tests ourself was quite simple, the case of rotated bitmaps did require some math on the transformations and intersecting polygon etc but it wasn&#039;t really hard to implement.</description>
		<content:encoded><![CDATA[<p>Excellent tips and tricks here. I recently implemented a sidescrolling choplifter-like game where we used bitmap collision and where performance got too low at first. The bitmap collision tests were eating all performance because there were a lot of enemies/objects etc. </p>
<p>Unfortunately I couldn&#8217;t get enough performance with the hitTest method on BitmapData so I implemented my own bitmap collision test method. The essential thing I added was a resolution parameter. E.g. if this parameter is 2 the collision test would only check every 2 pixels for collision. I ended up using a resolution of 3 which was very accurate, at least I didn&#8217;t see any difference, and this did give a lot of extra performance (the performance is increased by resolution*resolution because it is regarded in horizontal and vertical direction).</p>
<p>For things like projectiles that are very small I used an other strategy because with the resolution the collision could miss while it was there. Those objects were regarded as simple point objects and only checked at one coordinate. This was implemented as a test at first and proved to be accurate enough for those objects because they were fast moving.</p>
<p>Implementing the bitmap collision tests ourself was quite simple, the case of rotated bitmaps did require some math on the transformations and intersecting polygon etc but it wasn&#8217;t really hard to implement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Foley</title>
		<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/comment-page-1/#comment-16440</link>
		<dc:creator>Zach Foley</dc:creator>
		<pubDate>Thu, 25 Jun 2009 23:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1754#comment-16440</guid>
		<description>Collision detection is great and all, but the tough follow-up question is &quot;now what&quot;. Checking to find if slow-moving bitmaps have overlapping pixels is (as you&#039;ve shown) easy. But determining how far they have overlapped, and the appropriate projection to separate them is what will trip many folks up. (my self included if it gets beyond Axis aligned bounding box collisions)
Can you speak to that topic a bit? Or do I need to finish my copy of &quot;Calculus for dummies&quot; and come back later?</description>
		<content:encoded><![CDATA[<p>Collision detection is great and all, but the tough follow-up question is &#8220;now what&#8221;. Checking to find if slow-moving bitmaps have overlapping pixels is (as you&#8217;ve shown) easy. But determining how far they have overlapped, and the appropriate projection to separate them is what will trip many folks up. (my self included if it gets beyond Axis aligned bounding box collisions)<br />
Can you speak to that topic a bit? Or do I need to finish my copy of &#8220;Calculus for dummies&#8221; and come back later?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikechambers</title>
		<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/comment-page-1/#comment-16439</link>
		<dc:creator>mikechambers</dc:creator>
		<pubDate>Thu, 25 Jun 2009 21:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1754#comment-16439</guid>
		<description>@tonypa

No, I havent, although this is what some of the libraries use. One of the things I have on my list is to try that strategy and compare the performance of it to BitmapData.hitTest.

mike chambers

mesh@adobe.com</description>
		<content:encoded><![CDATA[<p>@tonypa</p>
<p>No, I havent, although this is what some of the libraries use. One of the things I have on my list is to try that strategy and compare the performance of it to BitmapData.hitTest.</p>
<p>mike chambers</p>
<p><a href="mailto:mesh@adobe.com">mesh@adobe.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tonypa</title>
		<link>http://www.mikechambers.com/blog/2009/06/25/strategies-for-optimizing-collision-detection-with-bitmapdata-hittest/comment-page-1/#comment-16438</link>
		<dc:creator>tonypa</dc:creator>
		<pubDate>Thu, 25 Jun 2009 20:32:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1754#comment-16438</guid>
		<description>Have you tried getColorBoundsRect? In theory you could use 1 bitmapdata, draw 1 object on it using colorTransform FF000 and other object using 00FF00, then get the rectangle of color FFFF00. Pixels of color FFFF00 should only exist in the area where objects overlap. Dont know about its speed, sorry.</description>
		<content:encoded><![CDATA[<p>Have you tried getColorBoundsRect? In theory you could use 1 bitmapdata, draw 1 object on it using colorTransform FF000 and other object using 00FF00, then get the rectangle of color FFFF00. Pixels of color FFFF00 should only exist in the area where objects overlap. Dont know about its speed, sorry.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
