For a long time now i'm working on a game engine in c++ using DirectX.
Last weekend i bought a good book about writing a physics engine.
Now i noticed that the book also covers collision detection, so i'm wondering where i should put this part.
My engine is split into different components (different DLL's) so if i only want to use parts of the engine in a game or application i dont need to implement the entire engine. This is how my engine looks like atm:
- Core (allways required)
- Graphics
- Sound
- Input
- Physics
- Game
Later a scripting engine will also be added. The game component is a kind of helper component that has the base code for a game (mainloop, engine implementation, callback functions for rendering ... kinda based on the DXUT lib)
Currently the collision detection is part of the graphics component cause its only used on the render objects.
So where should i put the collision detection part? Keep it in the graphics component or put it in the physics engine?
I'm using custom vector, matrix, ... structures that are inline files. Those are in the SDK include files and not part of any engine component. The graphics component is using these files from the SDK, so will the physics engine, so that the render engine and physics engine are compactible with eachother and no convertions are needed.