Skip to main content

Crate fast_mesh_bvh

Crate fast_mesh_bvh 

Source
Expand description

Incrementally updatable bounding volume hierarchy for meshes stored in fast_mesh_store.

Every fallible operation is failure-atomic: all memory it needs is reserved before the tree is touched, so on error the BVH is left as it was. The two optional follow-up steps of Bvh::update (rebuilding degraded treelets and compacting storage) never report errors: if memory runs out they are skipped and the tree stays correct.

Structs§

Aabb
Axis-aligned bounding box in mesh-local coordinates.
BuildOptions
Options for building (and rebuilding parts of) a BVH.
Bvh
Bounding volume hierarchy over the alive triangles of one Mesh, in mesh-local coordinates. Keep it current with Bvh::update.
BvhBuild
Bvh::build cut into steps, so that a caller can yield between them: the triangles’ boxes are collected, then the tree is built a bounded amount of work per step, then its treelets are assigned (subtree counts, roots and costs), also a bounded amount per step.
NodeId
Identifies a node of one Bvh. Only valid until that BVH is next modified (updated, refit or rebuilt).
NodeView
A node’s bounds and contents.
UpdatePolicy
When update falls back to heavier strategies.
UpdateReport
What update did, for diagnostics and benchmarks.

Enums§

BvhError
Errors returned by BVH operations. On any error the BVH is left exactly as it was before the call: every operation reserves the memory it needs before it changes the tree (best-effort steps that run afterwards are skipped silently instead of failing).
NodeKind
What a node holds.
Quality
How the tree is split when it is built.
Strategy
How update brought the tree up to date.

Type Aliases§

Result