pub type PlaneSplitter = BspSplitter<PlaneSplitAnchor>;
Expand description
A concrete plane splitter type used in WebRender.
Aliased Type§
struct PlaneSplitter { /* private fields */ }
Implementations
Source§impl<A> BspSplitter<A>where
A: Copy,
impl<A> BspSplitter<A>where
A: Copy,
Sourcepub fn new() -> BspSplitter<A>
pub fn new() -> BspSplitter<A>
Create a new BSP splitter.
Source§impl<A> BspSplitter<A>
impl<A> BspSplitter<A>
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Put the splitter back in it initial state.
Call this at the beginning of every frame when reusing the splitter.
Sourcepub fn add(&mut self, poly: Polygon<A>)
pub fn add(&mut self, poly: Polygon<A>)
Add a polygon to the plane splitter.
This is where most of the expensive computation happens.
Sourcepub fn sort(&mut self, view: Vector3D<f64, UnknownUnit>) -> &[Polygon<A>]
pub fn sort(&mut self, view: Vector3D<f64, UnknownUnit>) -> &[Polygon<A>]
Sort the added and split polygons against the view vector.
Call this towards the end of the frame after having added all polygons.