I would just show something that I've developed for Ogre. It's a part of a game, and this could be considered like a very important part of this game: A voxel map. (a minecraft like world)
At the start, my idea was to create a simple map, nothing fancy, and I've followed a tutorial on how ones could create a voxel map with Ogre3D.
But, at this time, the code was everything but generic and flexible, and a lot of operations on the voxel map couldn't be done.
And I spent a lot of time creating something that I could use as I wish and that could be as generic as possible. (and this is my point of view, but I think the code has enough features for a finite voxel environment)
Now I think the code is quite good for a public "release" (the code, not the comments . I am not a native English speaker, and my English is really really poor )
Some screenshots of some tests of this voxel map
(technical notes: I use the deferred shading sample; there is no reflection, just transparency; sorry for the mouse pointer )
and a link to a GIT repo for a demo: https://bitbucket.org/neam/cr-chunk_map/src (only tested on GNU/Linux, gcc 4.7.2, ogre 1.8.1. If you want to try it on windows, you must have a c++11 compiler)
What features make this code special:
- - The ability to change the material of some blocks (in the screenshots, there is the lava and the lights blocks that have a different material)
- The creation of hooks on some blocks type is possible (the different lights blocks in the screenshots), plus the information if the block is visible or not
- An A* implementation (even though it is not heavily optimised )
- Constant time access and modification of the map (but not to update its graphical representation)
- Really simple to use !!
- - The time to update the ManualObjects is really too slow, and as I add some new features, its complexity increase and thus the time to update the map...
- No shadows, no lights, no ambient occlusion. (nothing specialized for the voxels, but some features of Ogre3D could address those lacks)
- Finite (although big) environment only.
I am open for every suggestions, improvements and everything that could be constructive (especially about the speed improvements that could be done !)
I've released this code because, before creating my own voxel environment, I have searched for something that could fit my needs, and be usable with Ogre3D, but the only libs that I have found are
really too much for my simple needs or couldn't be used easily for what I wanted to do.
With this code, I've also released some classes/functions that could be really nice for beginners, and others that could simplify a lot some repetitive things.
So, feel free to use this code in your project
Keep also in mind that I am a third year IT student, and that I've discovered Ogre3D 6 months ago.
I hope this will be useful !!