Tuesday, November 16, 2010

Close to the end of sprint #2

For today, I've optimized the collision detection code by splitting our 3D space into regions and create lists that would keep track of the current objects in those regions. By doing so, the number of iterations the collision detection would have to do decreases dramatically especially when there are large number of objects. Instead of performing useless checks with objects that are opposite of the 3D space, only objects within a certain region in space can check against each other. In addition, if objects are in the same region, I perform another optimization to make sure that objects are within a certain distance of one another before continuing on with the check. For space objects for example, I would allow 2 objects to have a maximum distance of 512. If the distance is outside of that 512, no collision checks will be performed. Eventually, after we have models with numerous meshes available to us, each model would have a large bounding sphere that would encircle the model with smaller bounding spheres for the actual collision detection. The large bounding sphere will allow us to do a simple check to make sure the bounding spheres are indeed intersecting before we do the meat of the collision which will require us to loop through all the smaller bounding spheres to make sure there is indeed a collision. I also edited the camera a bit so that the camera is not created within the player but by the level. Because we can now use locators to define create tags for our model, we can simply create locators for the camera position for a specific ship and then assign the camera to the locator we want. For the remainder of the sprint, I plan to help the others finish their task and I will also take a look into the pod having difficulties firing at their designated position.

No comments:

Post a Comment