Struct ncollide3d::procedural::TriMesh [−][src]
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.
Implementations
impl<N: RealField> TriMesh<N>
[src]
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]
coords: Vec<Point<N>>,
normals: Option<Vec<Vector<N>>>,
uvs: Option<Vec<Point2<N>>>,
indices: Option<IndexBuffer>
) -> TriMesh<N>
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(&mut self, t: &Translation<N>)
[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]
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]
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]
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]
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
Auto Trait Implementations
impl<N> RefUnwindSafe for TriMesh<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for TriMesh<N>
impl<N> Sync for TriMesh<N>
impl<N> Unpin for TriMesh<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for TriMesh<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]