Wednesday, May 18, 2011

From Big to Small and Everything in Between

I've been busy getting my collision hierarchy working and can happily report successes in that department! I'm really excited! Since getting my collision model to display as I mentioned in the previous post, I have added another sphere around the collision model and gotten rid of the object's original bounding sphere (which did not take the collision model into account). That main sphere is now the root of the hierarchy tree. If the main roots of two tripod's collide, I go on to test their individual legs. I now have the tests for level 0 and level 1 of the tree working, so when the tripod's collide, the colliding legs' spheres and root spheres turn red! What's left is the specific portions of the legs, represented by the baby spheres. The only downside to the work I've done so far is that it is not automated. I do not have my code set up so that I can just run through all of the spheres and check for collisions in a loop. Instead, I wrote all of the tests out. This works just fine and is even more readable but, it is also not the way to do when working with objects that have significantly more bounding spheres; especially in cases where they are self generated. I am going to complete my collision hierarchy code this way first and then if I have time, rework my code to be more dynamic. I'm excited to continue this tomorrow and complete my collision hierarchy!


Here are screenshots that I took earlier today when I had gotten the main spheres collisions working:

Mains Colliding

Mains Not Colliding

No comments:

Post a Comment