Struct rin::graphics::Mesh[][src]

pub struct Mesh<T> { /* fields omitted */ }

A Mesh with any vertex type

Contains vertices that can be of any type although rin define a few of the most commonly used and optionally indices

Also a primitive type that defines how the vertices / indices should be parsed

Implementations

impl<T> Mesh<T>[src]

pub fn new(
    vertices: Vec<T, Global>,
    indices: Vec<u32, Global>,
    primitive_type: PrimitiveType
) -> Mesh<T>
[src]

Mesh from vertices, indices and primitive type

pub fn from_vertices(vertices: Vec<T, Global>) -> Mesh<T>[src]

Triangles mesh from vertices with no indices

pub fn from_vertices_and_type(
    vertices: Vec<T, Global>,
    ty: PrimitiveType
) -> Mesh<T>
[src]

Mesh with no indices from vertices and primitive type

pub fn from_iter_and_type<I>(vertices: I, ty: PrimitiveType) -> Mesh<T> where
    I: Iterator<Item = T>, 
[src]

Mesh with no indices from vertices iterator and primitive type

pub fn from_vertices_indices(
    vertices: Vec<T, Global>,
    indices: Vec<u32, Global>
) -> Mesh<T>
[src]

Triangles mesh from vertices and indices

pub fn with_type(ty: PrimitiveType) -> Mesh<T>[src]

Empty mesh with the specified primitive type

pub fn set_vertices(&mut self, vertices: Vec<T, Global>)[src]

Set the mesh vertices

pub fn set_indices(&mut self, indices: Vec<u32, Global>)[src]

Set the mesh vertices

pub fn indices(&self) -> &Vec<u32, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

pub fn indices_mut(&mut self) -> &mut Vec<u32, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

pub fn vertices(&self) -> &[T]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

pub fn vertices_mut(&mut self) -> &mut Vec<T, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

pub fn vertices_indices_mut(
    &mut self
) -> (&mut Vec<T, Global>, &mut Vec<u32, Global>)
[src]

pub fn iter(&self) -> Iter<'_, T>[src]

Iterator over the mesh vertices in the order they where inserted

pub fn iter_mut(&mut self) -> IterMut<'_, T>[src]

Mutable iterator over the mesh vertices in the order they where inserted

pub fn into_iter(self) -> IntoIter<T, Global>[src]

Consume the mesh into an iterator over it’s vertices in the order they where inserted

pub fn pop(&mut self) -> Option<T>[src]

Pop the last vertex

pub fn push(&mut self, value: T)[src]

Push a vertex at the end of the mesh

pub fn extend<I>(&mut self, other: I) where
    I: IntoIterator<Item = T>, 
[src]

Extend the mesh with an iterator of new vertices

pub fn insert(&mut self, index: usize, element: T)[src]

Insert a vertex at a certain position

pub fn get_mut(&mut self, index: usize) -> &mut T[src]

Mutably get the vertex at the specified position.

Will panic if the vertex doesn’t exist

pub fn reserve(&mut self, capacity: usize)[src]

Reserve as much capacity for vertices

pub unsafe fn set_len(&mut self, len: usize)[src]

Unsafe operation that sets the len of the vertices collection

pub fn truncate(&mut self, len: usize)[src]

Truncate the mesh vertices at the specified len

pub fn last(&self) -> Option<&T>[src]

Last vertex if there’s any

pub fn last_mut(&mut self) -> Option<&mut T>[src]

Last vertex mutably if there’s any

pub fn primitive_type(&self) -> PrimitiveType[src]

Primitive type

pub fn set_primitive_type(&mut self, ty: PrimitiveType)[src]

pub fn add_face(&mut self, i0: u32, i1: u32, i2: u32)[src]

Add a triangle face (only for Triangles primitive type)

pub fn clear(&mut self)[src]

Clear the mesh vertices and indices

pub fn clear_vertices(&mut self)[src]

Clear the vertices

pub fn clear_indices(&mut self)[src]

Clear the indices

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

Number of vertices

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

Contains any vertices

pub fn as_slice(&self) -> MeshSlice<'_, T>[src]

pub fn faces(&self) -> Box<dyn Iterator<Item = [&T; 3]>, Global>[src]

pub fn faces_mut(&mut self) -> Box<dyn Iterator<Item = [&mut T; 3]>, Global>[src]

impl<T> Mesh<T> where
    T: Clone
[src]

pub fn into_faces(self) -> Box<dyn Iterator<Item = [T; 3]> + 'static, Global> where
    T: 'static, 
[src]

impl<T> Mesh<T> where
    T: Clone
[src]

pub fn extend_from_mesh(&mut self, other: &Mesh<T>)[src]

Extend the mesh with another mesh

The vertices and indices will just be inserted at the end without taking into account the primitive types

pub fn extend_from_slice(&mut self, other: &[T])[src]

Extend the mesh with a slice of new vertices

Trait Implementations

impl<T> AsMut<[T]> for Mesh<T>[src]

impl<T> AsRef<[T]> for Mesh<T>[src]

impl<T> Borrow<[T]> for Mesh<T>[src]

impl<T> BorrowMut<[T]> for Mesh<T>[src]

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

impl<T> Debug for Mesh<T> where
    T: Debug
[src]

impl<T> Default for Mesh<T>[src]

impl<'de, T> Deserialize<'de> for Mesh<T> where
    T: Deserialize<'de>, 
[src]

impl<T> FromIterator<T> for Mesh<T>[src]

impl<T> Index<usize> for Mesh<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<usize> for Mesh<T>[src]

impl<T> Into<(Vec<T, Global>, Vec<u32, Global>)> for Mesh<T>[src]

impl<'a, T> Into<Data<'a, T>> for &'a Mesh<T> where
    T: Clone
[src]

impl<T> Into<Vec<T, Global>> for Mesh<T>[src]

impl<T> Serialize for Mesh<T> where
    T: Serialize
[src]

impl ToSimpleVao<Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>, Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>> for Mesh<Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>>[src]

impl ToSimpleVao<Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>, Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>> for Mesh<Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>>[src]

impl<T> ToSimpleVao<T, Mesh<T>> for Mesh<T> where
    T: 'static + VertexFormat + Clone
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Mesh<T> where
    T: RefUnwindSafe

impl<T> Send for Mesh<T> where
    T: Send

impl<T> Sync for Mesh<T> where
    T: Sync

impl<T> Unpin for Mesh<T> where
    T: Unpin

impl<T> UnwindSafe for Mesh<T> where
    T: UnwindSafe

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[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
[src]

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

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

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

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[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]

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>, 
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]