Bits of Eight - Day 4
I spent most of this evening working on the collision detection for our game. Cannonballs can now hit, and the ships can crash into each other. This was all done with spherical collision volumes because the maths is easy and relatively fast. I did this in TDD style with nosetests, which may have saved hours of debugging.
There was only one problem with integrating the physics, which was to do with using a simple translate rather than a matrix transform. To help debug it I made the engine draw the collision volumes... with full lighting, of course:
I also split the model into pieces, which allows the sails to adjust to the wind direction (and also swap out for reefed sails etc):
This actually results in rather more draw calls and material swaps so performance has dropped off a bit. I've started looking for improvements in the renderer eg. grouping by material, but for now it's time to turn in for the night.