pub trait Geometry {
    // Required methods
    fn num_faces(&self) -> usize;
    fn num_vertices_of_face(&self, face: usize) -> usize;
    fn position(&self, face: usize, vert: usize) -> [f32; 3];
    fn normal(&self, face: usize, vert: usize) -> [f32; 3];
    fn tex_coord(&self, face: usize, vert: usize) -> [f32; 2];

    // Provided methods
    fn set_tangent(
        &mut self,
        tangent: [f32; 3],
        _bi_tangent: [f32; 3],
        _f_mag_s: f32,
        _f_mag_t: f32,
        bi_tangent_preserves_orientation: bool,
        face: usize,
        vert: usize
    ) { ... }
    fn set_tangent_encoded(
        &mut self,
        _tangent: [f32; 4],
        _face: usize,
        _vert: usize
    ) { ... }
}
Expand description

The interface by which mikktspace interacts with your geometry.

Required Methods§

source

fn num_faces(&self) -> usize

Returns the number of faces.

source

fn num_vertices_of_face(&self, face: usize) -> usize

Returns the number of vertices of a face.

source

fn position(&self, face: usize, vert: usize) -> [f32; 3]

Returns the position of a vertex.

source

fn normal(&self, face: usize, vert: usize) -> [f32; 3]

Returns the normal of a vertex.

source

fn tex_coord(&self, face: usize, vert: usize) -> [f32; 2]

Returns the texture coordinate of a vertex.

Provided Methods§

source

fn set_tangent( &mut self, tangent: [f32; 3], _bi_tangent: [f32; 3], _f_mag_s: f32, _f_mag_t: f32, bi_tangent_preserves_orientation: bool, face: usize, vert: usize )

Sets the generated tangent for a vertex. Leave this function unimplemented if you are implementing set_tangent_encoded.

source

fn set_tangent_encoded( &mut self, _tangent: [f32; 4], _face: usize, _vert: usize )

Sets the generated tangent for a vertex with its bi-tangent encoded as the ‘W’ (4th) component in the tangent. The ‘W’ component marks if the bi-tangent is flipped. This is called by the default implementation of set_tangent; therefore, this function will not be called by the crate unless set_tangent is unimplemented.

Implementors§