#[repr(C)]pub struct Vertex {
pub pos: [f32; 2],
pub uv: [f32; 2],
pub color: Color,
}Expand description
A mesh vertex: a position in surface pixels, a normalized texture coordinate, and a premultiplied color that multiplies the sampled texel.
The layout is fixed at 20 bytes (#[repr(C)]: four f32 then four color bytes), so
vertex data can be produced in bulk by other code without conversion.
Fields§
§pos: [f32; 2]Position in surface pixels; see the crate docs for the coordinate conventions.
uv: [f32; 2]Texture coordinate, 0.0..=1.0 across the texture. Untextured meshes sample white
wherever it points, but it must still be finite.
color: ColorPremultiplied color, multiplied with the sampled texel.
Implementations§
Trait Implementations§
impl Copy for Vertex
impl StructuralPartialEq for Vertex
Auto Trait Implementations§
impl Freeze for Vertex
impl RefUnwindSafe for Vertex
impl Send for Vertex
impl Sync for Vertex
impl Unpin for Vertex
impl UnsafeUnpin for Vertex
impl UnwindSafe for Vertex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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