It Begins!

Due to reasons I don't want to get into too much here, I finally decided to get up off the dang couch and do some work on my side project.

The original plan was figure out how to make a semi-decent collision method between two meshes (arbitrarily created in Maya). The goal was to use this method to develop a game I've dubbed Boulder. The key concept in Boulder is well.... large boulder like pieces of geometry colliding off each other and the player doing what he can to cling to each one and stay in the air.

I've been randomly taking notes attempting to figure how in sam-hell I am going to do this. So rather then get too caught in finding the "perfect" way, I just sketched up a semi-decent plan. So here is what I've got:

For each mesh, I generate a Bounding Volume Hiearchy. With this BVH, I place an id at every node. For each object that needs to use that geometry for collision, they create a linear list of Bounding Volumes that has a "copy" of each one located in the hierarchy. The idea is that the id in each node corresponds to an index in the instanced list. So at the top of each frame, we iterate throught the BVH and update the copied bounding volume in the list. This allows us to "flatten" the hiearchy for that individual instance. At this point we now have a BVH and properly-calculated bounding volumes. At this point, we can do some intersection testing using the BVH and the list. Eventually we will get down to child nodes and then can analyze the triangles to get more exact collision response.

Right now I've got a working model up that uses poorly calculated OBB-based BVH. Right now they are essentially AABBs that maintain orientation with the object. I'm going to come back to properly calculating an OBB around a group of triangles later. For now I'm going to use my initial version to get two of these BVH based objects to intersect and then properly seperate.

From the pic below, you can see the OBB that are detected intersecting the floor. These could be further checked with the triangles stored within (thought I haven't completly figure that whole part out).



Hopefully, when this is all done, I'll be able to have different models bouncing off each other while the player bounces off them.

No comments: