[−][src]Struct ncollide3d::procedural::TriMesh
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]
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<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,
N: RefUnwindSafe + Scalar,
impl<N> Send for TriMesh<N> where
N: Scalar,
N: Scalar,
impl<N> Sync for TriMesh<N> where
N: Scalar,
N: Scalar,
impl<N> Unpin for TriMesh<N> where
N: Scalar + Unpin,
N: Scalar + Unpin,
impl<N> UnwindSafe for TriMesh<N> where
N: Scalar + UnwindSafe,
N: Scalar + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,