pub struct SolidMesh {
pub vertices: Vec<SolidVertex>,
pub indices: Vec<u32>,
}Expand description
A solid-colour triangle mesh.
The mesh is uploaded to the GPU verbatim: the vertex buffer is the
vertices array reinterpreted as SolidVertex, and the index buffer
is the indices array. Keeping the two in a single struct lets the
backends share one upload path and one pipeline layout.
Fields§
§vertices: Vec<SolidVertex>The vertices.
indices: Vec<u32>The triangle indices.
Implementations§
Source§impl SolidMesh
Inherent implementation of SolidMesh.
impl SolidMesh
Inherent implementation of SolidMesh.
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Sourcepub fn reserve(&mut self, vertices: usize, triangles: usize)
pub fn reserve(&mut self, vertices: usize, triangles: usize)
Reserves room for the given number of vertices and triangles.
§Arguments
usize- A non-negative integer (usize).
Sourcepub fn push_triangle(&mut self, a: SolidVertex, b: SolidVertex, c: SolidVertex)
pub fn push_triangle(&mut self, a: SolidVertex, b: SolidVertex, c: SolidVertex)
Sourcepub fn push_quad(
&mut self,
a: SolidVertex,
b: SolidVertex,
c: SolidVertex,
d: SolidVertex,
)
pub fn push_quad( &mut self, a: SolidVertex, b: SolidVertex, c: SolidVertex, d: SolidVertex, )
Source§impl SolidMesh
impl SolidMesh
pub fn get_vertices(&self) -> &Vec<SolidVertex>
pub fn get_mut_vertices(&mut self) -> &mut Vec<SolidVertex>
pub fn set_vertices(&mut self, val: Vec<SolidVertex>) -> &mut Self
pub fn get_indices(&self) -> &Vec<u32>
pub fn get_mut_indices(&mut self) -> &mut Vec<u32>
pub fn set_indices(&mut self, val: Vec<u32>) -> &mut Self
Trait Implementations§
impl StructuralPartialEq for SolidMesh
Auto Trait Implementations§
impl Freeze for SolidMesh
impl RefUnwindSafe for SolidMesh
impl Send for SolidMesh
impl Sync for SolidMesh
impl Unpin for SolidMesh
impl UnsafeUnpin for SolidMesh
impl UnwindSafe for SolidMesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more