@N-18 said: I can already imagine a character walking on top of that terrain. And with that come some ideas for a game.I see the MeshGenerator interface has a method named buildMesh that returns a Mesh object. I didn’t found it yet but I think that mesh will in time go to a Geometry object. May be that you are building a RigidBodyControl using that mesh to create a CollisionShape? That is how I’m Physicallizing my terrain in my voxels experiment, using the Mesh object that results from decoding a chunk of the map, but your previous comment suggests you are doing something more complex than that.
Looks amazing with a NVidia GTX650 and Windows 7.
If you wanted to do conventional physics then that’s how you would do it. The IsoSurfaceZone is what uses the Mesh and makes Geometry. It builds the mesh on a background thread run by the PagedGrid. During that time you could also make a collision mesh.
I had a theory that the raw density field could be used for collision detection even if no geometry was generated. This experiment shows that for some use-cases it could work. For larger objects, they would have to be broken down into small spheres to use this particular approach. Different things could be done to improve its accuracy but in the end if you need truly accurate physics then you’d want a real collision mesh.
However, for a lot of use-cases (say finding the height of terrain to place an object or building, placing units for an RTS, plotting routes, etc.) then the density field and this technique are enough.
Essentially, at any point in 3D space, you can sample what the density is. Less than 0 is open space, greater than 0 is solid space. You can also sample the ‘field direction’ at any point which is sort of the average gradient change of the density field. (This is also used to calculate the normals at the surface.) With these things and a little math, you can approximate collisions with the solid surface.