The hollow shell could be filled with a 3D implementation of floodfill or similar recursive algorithms.
The problem is, that the mesh has to be closed for that or it will mess up horribly.
One other way would be to generate the voxeldata in a complete different way...
I decided to use a divide and conquer algorithm for Voxelization... (Later on in process of my project)
Code:
1. Decide on a size for the Volume. ( I am going to compute it from a wanted resolution and the bounding volume of the given meshes. )
2. Test the given "CollisionBox" against the Mesh.
- If it collides:
- Is it as small as a Voxel? -> Set it solid.
- Else: Split it into 8 smaller CollisionBoxes and repeat step 2.
-If not: Discard the whole box.
3. You got it... Save the Volume. ( You could convenietly save it as an octree that way. )
The given Term "CollisionBox" ( Im not very creative with names... And english isn't my native language, so i apologize... ) simply means, that we got a defined area which we can test against the mesh. We have to test against a meshaccurate bounding, not against the mesh boundingbox, which makes this approach kinda expensive and nothing suitable for a real time approach if it isn't done on an extern thread...
( Does this method even sound viable?
)