Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

AttributedClipPlane

Trait AttributedClipPlane 

Source
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§

Source

type Distance: Copy

Signed-distance representation used by the renderer.

Required Methods§

Source

fn distance(&self, source_index: usize, vertex: &Vertex) -> Self::Distance

Signed distance of vertex from the retained half-space.

Source

fn inside(&self, distance: Self::Distance) -> bool

Whether distance lies in the retained half-space.

Source

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.

Implementors§