the official as3isolib blog

actionscript3 isometric library (v1/v2)

Collision Detection hookup API proposal

Over the last 6 months since the official beta release, many have inquired about a means to do collision detection.  Currently the only ways to do collision detection are:

  • implementing a custom ISceneLayoutRenderer and inserting the collision detection and solver algorithms within the implementation.  This is currently the best solution as it allows the developer to leverage any existing object comparison loops.  It does have the down fall of coupling your collision detection logic with your layout sorting.
  • perform collision detection and solving algorithms outside of the scene layout rendering phase.  This can be completely decoupled from the layout sorting but it also entails looping through the objects for comparison and then looping through them again when sorting them for layout in the ISceneLayoutRenderer.

Both work, both have some impact on code abstraction and performance.  What I would like is to utilize an interface in a similar fashion to this:

public interface ISceneLayoutRenderer extends ISceneRenderer

//the function signature would be like so:
//collisionDetectionFunction (objA:Object, objB:Object):void

function get collisionDetection ():Function;
function set collisionDetection (value:Function):void;

So I would like to ask the community about their thoughts, concerns and experiences.  Having this interface might allow for a developer to leverage a collision detection API from a physics engine.  I haven’t any experience with any physics libraries + as3isolib.  Do you think the expected signature function is robust enough for any of the open-source physics libraries out there?


4 responses to “Collision Detection hookup API proposal

  1. niraj November 14, 2009 at 2:15 am

    i think we must be using box2d for this job

  2. Greg March 7, 2010 at 9:59 am

    I agree on box2d and an interface with a basic class demonstrating implementation.

  3. raul August 19, 2010 at 4:19 am

    have you tried with Jiglibflash??

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: