Struct ncollide_procedural::TriMesh [] [src]

pub struct TriMesh<P: Point> {
    pub coords: Vec<P>,
    pub normals: Option<Vec<P::Vect>>,
    pub uvs: Option<Vec<Pnt2<P::Vect::Scalar>>>,
    pub indices: IndexBuffer,
}

Shapeetric description of a mesh.

Fields

coords: Vec<P>

Coordinates of the mesh vertices.

normals: Option<Vec<P::Vect>>

Coordinates of the mesh normals.

uvs: Option<Vec<Pnt2<P::Vect::Scalar>>>

Textures coordinates of the mesh.

indices: IndexBuffer

Index buffer of the mesh.

Methods

impl<P: Point> TriMesh<P>
[src]

fn new(coords: Vec<P>, normals: Option<Vec<P::Vect>>, uvs: Option<Vec<Pnt2<P::Vect::Scalar>>>, indices: Option<IndexBuffer>) -> TriMesh<P>

Creates a new TriMesh.

If no indices is provided, trivial, sequential indices are generated.

fn has_normals(&self) -> bool

Whether or not this triangle mesh has normals.

fn has_uvs(&self) -> bool

Whether or not this triangle mesh has texture coordinates.

fn translate_by<T: Translate<P>>(&mut self, t: &T)

Translates each vertex of this mesh.

fn transform_by<T: Transform<P> + Rotate<P::Vect>>(&mut self, t: &T)

Transforms each vertex and rotates each normal of this mesh.

fn num_triangles(&self) -> usize

The number of triangles on this mesh.

impl<P: Point> TriMesh<P>
[src]

fn rotate_by<R: Rotate<P::Vect>>(&mut self, r: &R)

Rotates each vertex and normal of this mesh.

impl<P> TriMesh<P> where P: Point, P::Vect: Cross<CrossProductType=P::Vect>
[src]

fn recompute_normals(&mut self)

Recomputes the mesh normals using its vertex coordinates and adjascency informations infered from the index buffer.

impl<P> TriMesh<P> where P: Point
[src]

fn scale_by(&mut self, s: &P::Vect)

Scales each vertex of this mesh.

impl<P: Point> TriMesh<P>
[src]

fn scale_by_scalar(&mut self, s: P::Vect::Scalar)

Scales each vertex of this mesh.

impl<P: Point> TriMesh<P>
[src]

fn unify_index_buffer(&mut self)

Force the mesh to use the same index for vertices, normals and uvs.

This might cause the duplication of some vertices, normals and uvs. Use this method to transform the mesh data to a OpenGL-compliant format.

impl<P> TriMesh<P> where P: Point + AsBytes
[src]

fn split_index_buffer(&mut self, recover_topology: bool)

Forces the mesh to use a different index for the vertices, normals and uvs.

If recover_topology is true, this will merge exactly identical vertices together.

Trait Implementations

impl<P: Debug + Point> Debug for TriMesh<P> where P::Vect: Debug
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<P: Clone + Point> Clone for TriMesh<P> where P::Vect: Clone
[src]

fn clone(&self) -> TriMesh<P>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more