Skip to main content

VertexMap

Trait VertexMap 

Source
pub trait VertexMap {
    // Required methods
    fn point(&self, p: [f32; 3]) -> [f32; 3];
    fn normal(&self, n: [f32; 3]) -> Option<[f32; 3]>;
    fn tangent(&self, t: [f32; 4]) -> Option<[f32; 4]>;
}
Expand description

A map of space a primitive’s vertices are moved by, one rule per Moves: the one way a pass moves vertex streams in place (move_streams), so every stream whose meaning moves is moved.

Required Methods§

Source

fn point(&self, p: [f32; 3]) -> [f32; 3]

A point (a position, a Semantic::Point).

Source

fn normal(&self, n: [f32; 3]) -> Option<[f32; 3]>

A surface normal. None where the map turns no normal (a singular map).

Source

fn tangent(&self, t: [f32; 4]) -> Option<[f32; 4]>

A tangent: xyz and the bitangent sign w. None where the map turns no tangent.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl VertexMap for Linear

Source§

impl VertexMap for Offset

Source§

impl VertexMap for SourceFrame

A frame conversion moves a mesh’s streams as it moves positions and directions: normals and tangents by the signed permutation (a uniform scale turns no direction), a tangent’s bitangent sign negated where the conversion mirrors.