[][src]Struct ncollide_procedural::TriMesh

pub struct TriMesh<P: Point> {
    pub coords: Vec<P>,
    pub normals: Option<Vec<P::Vector>>,
    pub uvs: Option<Vec<Point2<P::Real>>>,
    pub indices: IndexBuffer,
}

Geometric description of a mesh.

Fields

coords: Vec<P>

Coordinates of the mesh vertices.

normals: Option<Vec<P::Vector>>

Coordinates of the mesh normals.

uvs: Option<Vec<Point2<P::Real>>>

Textures coordinates of the mesh.

indices: IndexBuffer

Index buffer of the mesh.

Methods

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

pub fn new(
    coords: Vec<P>,
    normals: Option<Vec<P::Vector>>,
    uvs: Option<Vec<Point2<P::Real>>>,
    indices: Option<IndexBuffer>
) -> TriMesh<P>
[src]

Creates a new TriMesh.

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

pub fn has_normals(&self) -> bool[src]

Whether or not this triangle mesh has normals.

pub fn has_uvs(&self) -> bool[src]

Whether or not this triangle mesh has texture coordinates.

pub fn translate_by<T: Translation<P>>(&mut self, t: &T)[src]

Translates each vertex of this mesh.

pub fn transform_by<T: Isometry<P>>(&mut self, t: &T)[src]

Transforms each vertex and rotates each normal of this mesh.

pub fn num_triangles(&self) -> usize[src]

The number of triangles on this mesh.

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

pub fn rotate_by<T: Rotation<P>>(&mut self, t: &T)[src]

Rotates each vertex and normal of this mesh.

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

pub fn recompute_normals(&mut self)[src]

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

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

pub fn scale_by(&mut self, s: &P::Vector)[src]

Scales each vertex of this mesh.

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

pub fn scale_by_scalar(&mut self, s: P::Real)[src]

Scales each vertex of this mesh.

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

pub fn unify_index_buffer(&mut self)[src]

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: Point + AsBytes> TriMesh<P>[src]

pub fn split_index_buffer(&mut self, recover_topology: bool)[src]

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: Clone + Point> Clone for TriMesh<P> where
    P::Vector: Clone,
    P::Real: Clone
[src]

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

Performs copy-assignment from source. Read more

impl<P: Debug + Point> Debug for TriMesh<P> where
    P::Vector: Debug,
    P::Real: Debug
[src]

Auto Trait Implementations

impl<P> Send for TriMesh<P> where
    <P as EuclideanSpace>::Real: Scalar + Send,
    <P as Point>::Vector: Send

impl<P> Sync for TriMesh<P> where
    <P as EuclideanSpace>::Real: Scalar + Sync,
    <P as Point>::Vector: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self