pub trait AttributedClipPlane<Vertex> {
type Distance: Copy;
// Required methods
fn distance(&self, source_index: usize, vertex: &Vertex) -> Self::Distance;
fn inside(&self, distance: Self::Distance) -> bool;
fn intersection(
&self,
first_index: usize,
first: &Vertex,
first_distance: Self::Distance,
second_index: usize,
second: &Vertex,
second_distance: Self::Distance,
) -> Vertex;
}Expand description
Renderer-specific policy for one attributed clip plane.
Implement this on a small adapter type. Generic dispatch is resolved at
compile time; no trait object or indirect call enters the console hot path.
source_index allows callers to reuse cached transformed distances.
Required Associated Types§
Required Methods§
Sourcefn distance(&self, source_index: usize, vertex: &Vertex) -> Self::Distance
fn distance(&self, source_index: usize, vertex: &Vertex) -> Self::Distance
Signed distance of vertex from the retained half-space.
Sourcefn inside(&self, distance: Self::Distance) -> bool
fn inside(&self, distance: Self::Distance) -> bool
Whether distance lies in the retained half-space.
Sourcefn intersection(
&self,
first_index: usize,
first: &Vertex,
first_distance: Self::Distance,
second_index: usize,
second: &Vertex,
second_distance: Self::Distance,
) -> Vertex
fn intersection( &self, first_index: usize, first: &Vertex, first_distance: Self::Distance, second_index: usize, second: &Vertex, second_distance: Self::Distance, ) -> Vertex
Interpolate every authored attribute at an edge/plane crossing.