Function meshopt::ffi::meshopt_simplify[][src]

pub unsafe extern "C" fn meshopt_simplify(
    destination: *mut c_uint,
    indices: *const c_uint,
    index_count: usize,
    vertex_positions: *const f32,
    vertex_count: usize,
    vertex_positions_stride: usize,
    target_index_count: usize,
    target_error: f32
) -> usize

Experimental: Mesh simplifier Reduces the number of triangles in the mesh, attempting to preserve mesh appearance as much as possible The algorithm tries to preserve mesh topology and can stop short of the target goal based on topology constraints or target error. If not all attributes from the input mesh are required, it’s recommended to reindex the mesh using meshopt_generateShadowIndexBuffer prior to simplification. Returns the number of indices after simplification, with destination containing new index data The resulting index buffer references vertices from the original vertex buffer. If the original vertex data isn’t required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended.

destination must contain enough space for the source index buffer (since optimization is iterative, this means index_count elements - not target_index_count!) vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer