Algorithms for generating triangle meshes from:
- height maps
- signed distance fields
- voxel occupancy grids
All of the algorithms are designed to be used with a ChunkMap, such that each chunk will have
its own mesh. In order to update the mesh for a chunk, you must copy not only the chunk, but
also some adjacent points, into an array before running the meshing algorithm.
An example of updating chunk meshes for a height map is shown below.
use *;
use *;
use *;
use HashSet;
let chunk_shape = PointN;
let mut map = new;
// Mutate one or more of the chunks...
let mutated_chunk_keys = ;
// For each mutated chunk, and any adjacent chunk, the mesh will need to be updated.
let mut chunk_keys_to_update: = new;
let offsets = moore_offsets;
for chunk_key in mutated_chunk_keys.into_iter
// Now we generate mesh vertices for each chunk.
let local_cache = new;
let reader = new;
for chunk_key in chunk_keys_to_update.into_iter