[−][src]Function all_is_cubes::triangulator::triangulate_space
pub fn triangulate_space<BV, GV, A>(
space: &Space,
blocks_render_data: &BlocksRenderData<BV, A>,
output_vertices: &mut FaceMap<Vec<GV>>
) where
BV: ToGfxVertex<GV>,
A: TextureAllocator,
Computes a triangle-based representation of a Space
for rasterization.
blocks_render_data
should be provided by triangulate_blocks
and must be up to
date (TODO: provide a means to ensure it is up to date).
The triangles will be written into output_vertices
, replacing the existing
contents. This is intended to avoid memory reallocation in the common case of
new geometry being similar to old geometry.
output_vertices
is a FaceMap
dividing the faces according to their normal
vectors.