pub struct MeshBuild { /* private fields */ }Expand description
A mesh being prepared for Scene::add_mesh_built outside any scene:
its BVH, and its vertex normals when asked for
(MeshBuild::set_normals), are built in steps (MeshBuild::step),
so that a caller can yield between them (the Worker engine adds large
meshes this way). Nothing of it is in a scene until it is added.
Implementations§
Source§impl MeshBuild
impl MeshBuild
Sourcepub fn new(mesh: Mesh, options: MeshOptions) -> Result<MeshBuild>
pub fn new(mesh: Mesh, options: MeshOptions) -> Result<MeshBuild>
Starts preparing mesh for Scene::add_mesh with options.
§Errors
SceneError::InvalidInput for an invalid placement; a BVH option
or memory error.
Sourcepub fn set_normals(&mut self, on: bool)
pub fn set_normals(&mut self, on: bool)
Turns the mesh’s vertex normals on or off (off by default), as
Scene::set_normals would right after the add: with them on, the
steps compute them too, once the BVH is built, and the mesh is added
with them on. Turning them off drops what was computed.
Sourcepub fn step(&mut self, budget: usize) -> Result<bool>
pub fn step(&mut self, budget: usize) -> Result<bool>
Builds about budget more units of the BVH (see
BvhBuild::step), then of the normals when they are on (a unit:
4 triangles or 16 vertices). Returns whether everything is built.
§Errors
A memory error; the build is unusable after it.