PDA

View Full Version : Fast/Accurate collisions


Nyad
02-27-2008, 09:48 AM
Hi

I am trying to test intersection between two quads without using the usual method.

I want to just do this
test if each vert in quad2 lies between verts of quad1
like:

sort q1x values into ascending order

I then test between the smallest and the largest value of x with the point
ie
if smallx <= quad2x and largex >= quad2x

and I do the same for my y values.

I am using this to test per quad on my objects made up of quads
to see if they collide, this will be done for many arbitrary quads.
The formula I am hoping is working is:
lim E = 0
E->0

where E is my error, so over many quads this will bring about a small error


Will this be faster than traditional methods or will it be way too slow or innacurate?

Reedbeta
02-27-2008, 12:51 PM
That sounds like what it comes down to is approximating each quad by an AABB.

So it will be a good approximation if your quads are nearly AABBs, but bad if they are not.

It will definitely be faster than doing actual quad intersections.

I don't understand the part of your post that talks about "many arbitrary quads" and the error going to zero in some limit. (By the way, the statement you've written says that E approaches zero as E approaches zero. Rather vacuous. ;))

Nyad
02-27-2008, 12:56 PM
yeah :)

well the whole object is made up of quads which do vary slightly of cource.
But yes they would be similar to AABB quads. Also they are very small as i aim to have high detail, high poly count objects so it is more or less accurate then.

Thanks, now that I know it is suited well it will make the engine simpler and faster