Hi there.
In Part 1 of this tutorial we looked briefly at one of the simplest techniques for collision detections – the radius (forgive me, if there’s a fancy name for it). A perfectly adequate solution for some games.
We also looked into what XNA has to offer out of the box, and why the BoundingBox class may not be suitable for some games, due to it’s Axis Aligned nature, and how that doesn’t work so well with rotated models.
If you missed part 1, check it out here…
Meanwhile, lets get on with this 2nd, and if all goes well, final part. By the end of this I hope I’ll have shared some sort of solution. I see it as an interim solution as I really hope Microsoft will address this in a future version of XNA.
In Part 1 I mentioned that there would be no working code sample. I lied. I found it so difficult to explain it all from bits and pieces of my game’s code, that I bit the bullet and made a working sample.
As you may already be aware, I’ve published this sample on the blog already. Feel free to grab it over here. I will be refering to code in the sample throughout the rest of this tutorial.
Bye bye BoundingBox, hello BoundingSphere.
Besides BoundingBox, XNA provides an BoundingSphere class for collision detection. Read the rest of this entry »
