Trait dae_parser::geom::VertexLoad[][src]

pub trait VertexLoad<'a, C: ?Sized = ()>: Clone {
    fn position(ctx: &C, reader: &SourceReader<'a, XYZ>, index: u32) -> Self;
fn add_normal(
        &mut self,
        ctx: &C,
        reader: &SourceReader<'a, XYZ>,
        index: u32
    );
fn add_texcoord(
        &mut self,
        ctx: &C,
        reader: &SourceReader<'a, ST>,
        index: u32,
        set: Option<u32>
    ); }
Expand description

A trait, to be implemented by user types, to describe how to construct a vertex object from the stored data. The context C is an arbitrary type that can be used for getting (or modifying, with interior mutability) additional data to create the object.

Required methods

Construct a new vertex using only position data.

The position index is provided as is, but the intended use is to call reader.get(i) and use the resulting [f32; 3] as the position.

Add normal data to a vertex.

The position index is provided as is, but the intended use is to call reader.get(i) and use the resulting [f32; 3] as the normal.

Add texture coordinate data to a vertex.

The position index is provided as is, but the intended use is to call reader.get(i) and use the resulting [f32; 2] as the u-v data.

Implementors