Trying something a bit different this time. I've integrated the excellent Bullet Physics API into my game this time, and the challenge is going to be attempting to implement my kinematic character controller using the Bullet API.
The KCC that ships with Bullet is still not good enough for what I need, but I was thinking ahead to things I'll want to put into my platformer and some of them (particularly rag-dolls for dead things) would take me years to implement myself but should be a breeze with Bullet. So I got to thinking, presumably there must be a way to use the Bullet API to make the equivalent queries that I was making with my own physics - basically intersection tests and ray casts, so, in theory at least, I should be able to have the best of both worlds here - Bullet to handle all the purely physical interactions and a custom-written character controller and so on when the physics simulation is not what is wanted.
Probably sounds a lot simpler than it will be in practice, but I've been toying with this idea in my head for a long time now so thought a nice clean slate project was a good way to put this to the test.
So far I have a Scene set up, with SceneNodes that can represent renderables, geared up to batch things that have similar graphics settings, a comprehensive GraphicsResource system that allows for graphics resources to be both global with URL's to access them, or locally owned via a ResourceHandle class, a bare-bones Physics class that manages instances of Body, a class that bridges between my code and the btRigidBody and an abstract Mode system that manages the various states of play (GameMode, MenuMode etc as required).
The current system can load an environment file from my very basic Sandbox level editor (basically polyhedrons placed and coloured in an interactive Qt application) and convert these to both a graphical mesh and to Bullet btConvexHullShapes.
You can currently move a capsule representing the player around in all three dimensions (no collisions at all) or click the mouse to create test boxes that are handed over to Bullet to simulate so we're finally at the critical point of starting to figure out how to do the character controller interactions using the Bullet API. Thankfully the source for Bullet's own KCC is available which should give me a good starting point. Need to figure out how to do ray casting (looks easy enough) and swept intersection tests on a shape to get a minimum separating vector. I think this latter is quite do-able as Bullet seems to support having stand-alone shapes that you can use to query the environment as far as I can tell.
So the interesting work begins here. All has been preparation up to this point and I'll be interested to see how we progress from here. Thanks for dropping by. Hopefully my next post will be about succeeding at this
[Loving the WOA Journals, but man does my entry move down the first page quick at the moment :) Going to have to make sure I update a bit more often until this chaos is over]