pub struct Mesh {
pub vertices: Vec<Vec<u8>>,
pub stride: usize,
pub layout: Vec<AttributeFormat>,
pub indices: Option<Vec<u8>>,
pub vertex_buffer: VertexBuffer,
pub changed: bool,
}Expand description
Asset with 3D model data
Fields§
§vertices: Vec<Vec<u8>>Packed array of vertices data
stride: usizeSize of all Vertex Attributes in bytes
layout: Vec<AttributeFormat>Vertex buffer layout
indices: Option<Vec<u8>>Optional indices
vertex_buffer: VertexBuffervertex buffer instance
changed: boolFlag to react on the mesh changes
Implementations§
Source§impl Mesh
impl Mesh
Sourcepub fn with_vertices<T>(&mut self, data: &[T])
pub fn with_vertices<T>(&mut self, data: &[T])
Adds Vertex Attributes to the mesh
Sourcepub fn with_indices(&mut self, indices: &[u32])
pub fn with_indices(&mut self, indices: &[u32])
Sets indicies to the mesh
Sourcepub fn vertex_buffer_layout(&self) -> &[AttributeFormat]
pub fn vertex_buffer_layout(&self) -> &[AttributeFormat]
Returns actual mesh vertex buffer layout
Trait Implementations§
Source§impl AssetMapGetter<Mesh> for Assets
impl AssetMapGetter<Mesh> for Assets
Auto Trait Implementations§
impl !Freeze for Mesh
impl !RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl !UnwindSafe for Mesh
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more