hitTest worth using for first pass?

Hey there,

At the moment I’m working on some generic utility code that I’m going to need for some of the games I’m planning, and a major piece of that is dealing with collision detection. Although I’m new to Flash, I’m quite aware that hitTest really sucks for most purposes, so I will definitely be writing my own fine-grained collision code. But here’s my question - the actual collision code will be pretty heavy, so I’ve been using the bounding box overlap test ( object1.hitTest(object2) ) as a first pass in my routines, just to quickly eliminate clips that can’t possibly be touching. Now I’m starting to wonder about the efficiency of the method…is it well optimized, or would it be worth the effort to roll my own crude test?

In C++ or Java I would usually handle this by doing a bounding box sort and creating an array that holds a list of all potential collisions, thus avoiding the O(N^2) pairwise comparison method except as a theoretical worst case. Is this already done in Flash when you hitTest? I suspect with enough objects the performance hit of the boolean comparisons (the if (mc1.hitTest(mc2)) clauses) might be bad enough alone to warrant writing my own handler, but has anyone ever had experience with this stuff in Flash? Ideally I’d love to be able to get 100 or more things in a simulation without breaking the frame rate too badly (which you usually can do in other languages), to give some sense of scale.

I’d appreciate any advice anyone can offer…