Back to the drawing board…

After some enthusiastic coding with the aim to integrate the ODE physics engine into my game engine, I ended up in a dead end with typical “who is using who” class problems (i.e. circular class usage). It all boiled down to a too flat class structure, so I realized that it was time to return to the drawing board - which meant Dia in my case.

After some work, I have now come up with a class structure that I think will hold. Basically, the “world object” class is now  the owner of three sub classes: GfxObject (the visual triangle object), PhysicsObject (the ODE object) and SoundObject (FMOD sound(s) for each world object, such as engine sounds etc).

The main point is that now the graphics engine, the physics engine and the sound engine are separated from each other, which will probably be a good thing once (if) network play  is implemented (i.e. a network server can easily be designed to run with graphics and sound disabled).

I am also currently looking into the art of collision detection. I believe I will have to write my own collision routines (i.e. mesh/mesh intersection) in order to best utilize the mesh instancing functionality of the game engine. It will probably save alot of memory too by avoiding duplicate representations of the triangle meshes (if you use ODE’s built in triangle mesh collision routines, ODE needs a copy of the mesh too).

Leave a Reply

You must be logged in to post a comment.