[][src]Struct ncollide3d::procedural::TriMesh

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

Geometric description of a mesh.

Fields

coords: Vec<Point<N>>

Coordinates of the mesh vertices.

normals: Option<Vec<Vector<N>>>

Coordinates of the mesh normals.

uvs: Option<Vec<Point2<N>>>

Textures coordinates of the mesh.

indices: IndexBuffer

Index buffer of the mesh.

Methods

impl<N: RealField> TriMesh<N>[src]

pub fn new(
    coords: Vec<Point<N>>,
    normals: Option<Vec<Vector<N>>>,
    uvs: Option<Vec<Point2<N>>>,
    indices: Option<IndexBuffer>
) -> TriMesh<N>
[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<Point<N>>>(&mut self, t: &T)[src]

Translates each vertex of this mesh.

pub fn transform_by(&mut self, t: &Isometry<N>)[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.

pub fn flat_indices(&self) -> Vec<u32>[src]

Returns only the vertex ids from the index buffer.

impl<N: RealField> TriMesh<N>[src]

pub fn recompute_normals(&mut self)[src]

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

pub fn flip_normals(&mut self)[src]

Flips all the normals of this mesh.

pub fn flip_triangles(&mut self)[src]

Flips the orientation of every triangle of this mesh.

pub fn scale_by(&mut self, s: &Vector<N>)[src]

Scales each vertex of this mesh.

impl<N: RealField> TriMesh<N>[src]

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

Scales each vertex of this mesh.

impl<N: RealField> TriMesh<N>[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.

pub fn replicate_vertices(&mut self)[src]

Unifies the index buffer and ensure duplicate each vertex are duplicated such that no two vertex entry of the index buffer are equal.

impl<N: RealField> TriMesh<N>[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<N: Clone + RealField> Clone for TriMesh<N>[src]

impl<N: Debug + RealField> Debug for TriMesh<N>[src]

impl<N: RealField> From<TriMesh<N>> for TriMesh<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for TriMesh<N> where
    N: RefUnwindSafe + Scalar

impl<N> Send for TriMesh<N> where
    N: Scalar

impl<N> Sync for TriMesh<N> where
    N: Scalar

impl<N> Unpin for TriMesh<N> where
    N: Scalar + Unpin

impl<N> UnwindSafe for TriMesh<N> where
    N: Scalar + UnwindSafe

Blanket Implementations

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

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

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

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,