View Full Version : [as2] Complex Collision Detection
marcelozep
July 15th, 2009, 03:32 PM
Hello.
I wonder, if thereīs a way to do a collision detection for irregular shapes (complex shapes).
I know about the g skinerīs class, and I canīt use it, because it needs to put the authorīs comments.
So, thereīs another way, free to use?
Thank you.
TOdorus
July 15th, 2009, 06:47 PM
I think what you're looking for is Box2D (http://box2dflash.sourceforge.net/). It is however written in AS3.
marcelozep
July 15th, 2009, 10:44 PM
Yes, something like this but with really irregular shapes, I mean, shapes with curves.
Thank you ;).
dandylion13
July 16th, 2009, 02:00 PM
You can try the the AS3.0 Collision Detection Kit
http://www.coreyoneil.com/portfolio/index.php?project=5
I've haven't used it before but it might be worth looking into.
SparK_BR
July 17th, 2009, 12:41 AM
i really don't know anything for AS2 about collision
(you can always write your own of course)
here's a good one for AS3 http://www.cove.org/ape/
flashmxboy
July 17th, 2009, 11:09 AM
Is this about hitTesting or physics engines??
If its about hitTesting you could use bitmapData.hitTest() if you have flash8 or later.
You could also try to set shapeFlag to true:
public hitTest(x, y, shapeFlag) : Boolean
public hitTest(target) : Boolean
x: Number The x coordinate of the hit area on the Stage.
y: Number The y coordinate of the hit area on the Stage. The x and y coordinates are defined in the global coordinate space.
shapeFlag: Boolean A Boolean value specifying whether to evaluate the entire shape of the specified instance (true), or just the bounding box (false). This parameter can be specified only if the hit area is identified by using x and y coordinate parameters.
TOdorus
July 17th, 2009, 11:32 AM
:)
And here we go thinking about advanced collision engines when we hear the keyword "irregular shape". That is actually a pretty good solution flashmxboy.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.