Struct ncollide::procedural::TriMesh
[−]
[src]
pub struct TriMesh<P> where P: Point { pub coords: Vec<P>, pub normals: Option<Vec<P::Vector>>, pub uvs: Option<Vec<PointBase<P::Real, U2, MatrixArray<P::Real, U2, U1>>>>, 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<PointBase<P::Real, U2, MatrixArray<P::Real, U2, U1>>>>
Textures coordinates of the mesh.
indices: IndexBuffer
Index buffer of the mesh.
Methods
impl<P> TriMesh<P> where P: Point
[src]
fn new(coords: Vec<P>,
normals: Option<Vec<P::Vector>>,
uvs: Option<Vec<PointBase<P::Real, U2, MatrixArray<P::Real, U2, U1>>>>,
indices: Option<IndexBuffer>)
-> TriMesh<P>
normals: Option<Vec<P::Vector>>,
uvs: Option<Vec<PointBase<P::Real, U2, MatrixArray<P::Real, U2, U1>>>>,
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>(&mut self, t: &T) where T: Translation<P>
Translates each vertex of this mesh.
fn transform_by<T>(&mut self, t: &T) where T: Isometry<P>
Transforms each vertex and rotates each normal of this mesh.
fn num_triangles(&self) -> usize
The number of triangles on this mesh.
impl<P> TriMesh<P> where P: Point
[src]
fn rotate_by<T>(&mut self, t: &T) where T: Rotation<P>
Rotates each vertex and normal of this mesh.
impl<P> TriMesh<P> where P: Point
[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]
impl<P> TriMesh<P> where P: Point
[src]
fn scale_by_scalar(&mut self, s: P::Real)
Scales each vertex of this mesh.
impl<P> TriMesh<P> where P: Point
[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 for TriMesh<P> where P: Debug + Point,
P::Vector: Debug,
P::Real: Debug
[src]
P::Vector: Debug,
P::Real: Debug
impl<P> Clone for TriMesh<P> where P: Clone + Point,
P::Vector: Clone,
P::Real: Clone
[src]
P::Vector: Clone,
P::Real: Clone