Hello,

I am currently working on a collision detection routine for an Android
based game which is capable of handling complex concave curves in 2D.
I use complex in this post to describe any non-trivial, arbitrary
shape (beyond circles, squares, etc.).  My problem is that all of the
various methods I have come across are either too simplistic to be
realistic or too complex for a cell phone.  At the moment I am
favoring a tile-based scheme but I am having problems figuring out how
to do this with convex curves that span several tiles and may have
several line segments per tile.  I gave some thought to representing
the curves mathematically, with each tile being an interval of the
function, but there will likely be points where the curve doubles-back
on itself (think the big loop at the top of a pinball table that
brings the ball all the way around the table and back the direction it
came).  My questions boil down to:

1.  Does anyone know of a way of hit testing a given simple shape (eg.
a circle) against a concave series of line segments (shapes beyond
circles can be figured out from there) beyond just a Boolean result?

2.  What is the best way to represent large, complex shapes
programatically?  I am currently favoring an XML file describing my
levels and the objects in them with shape/position/physics/etc. data
to be parsed in during load time.

3.  Is there an altogether better way of doing this beyond line
segments?

The one saving grace in this conundrum is that I know the vast
majority of the objects are stationary with, at most, three or four
(usually one) dynamic objects moving around.  Thanks in advance for
any help.

-cheers

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to