pub trait Geometry {
    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]; 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

Returns the number of faces.

Returns the number of vertices of a face.

Returns the position of a vertex.

Returns the normal of a vertex.

Returns the texture coordinate of a vertex.

Provided methods

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

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