pub struct Vertex3D { /* private fields */ }Expand description
Single 64-byte cache/GPU-aligned 3D mesh vertex storing position, normal, Lengyel tangent, dual UVs, and vertex color.
Implementations§
Source§impl Vertex3D
Compact and full attribute constructors for Vertex3D.
impl Vertex3D
Compact and full attribute constructors for Vertex3D.
Sourcepub const fn from_pos_normal(position: Vec3, normal: Vec3) -> Self
pub const fn from_pos_normal(position: Vec3, normal: Vec3) -> Self
Sourcepub const fn from_full(
position: Vec3,
normal: Vec3,
tangent: [f32; 4],
uv0: [f32; 2],
uv1: [f32; 2],
color0: [u8; 4],
flags: u32,
) -> Self
pub const fn from_full( position: Vec3, normal: Vec3, tangent: [f32; 4], uv0: [f32; 2], uv1: [f32; 2], color0: [u8; 4], flags: u32, ) -> Self
Constructs a fully populated 64-byte Vertex3D with tangent, dual UVs, vertex color, and attribute flags.
§Arguments
Vec3- Local-space 3D position.Vec3- Local-space unit surface normal.[f32; 4]- Tangent vector(tx, ty, tz, handedness_sign).[f32; 2]- Primary UV coordinate (TEXCOORD_0).[f32; 2]- Secondary UV coordinate (TEXCOORD_1).[u8; 4]- Packed UNORM8 RGBA vertex color (COLOR_0).u32- Attribute bitmask flags.
§Returns
Self- Fully populated 64-byte vertex.
Source§impl Vertex3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl Vertex3D
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_position(&self) -> Vec3
pub fn get_mut_position(&mut self) -> &mut Vec3
pub fn set_position(&mut self, val: Vec3) -> &mut Self
pub fn get_normal(&self) -> Vec3
pub fn get_mut_normal(&mut self) -> &mut Vec3
pub fn set_normal(&mut self, val: Vec3) -> &mut Self
pub fn get_tangent(&self) -> [f32; 4]
pub fn get_mut_tangent(&mut self) -> &mut [f32; 4]
pub fn set_tangent(&mut self, val: [f32; 4]) -> &mut Self
pub fn get_uv0(&self) -> [f32; 2]
pub fn get_mut_uv0(&mut self) -> &mut [f32; 2]
pub fn set_uv0(&mut self, val: [f32; 2]) -> &mut Self
pub fn get_uv1(&self) -> [f32; 2]
pub fn get_mut_uv1(&mut self) -> &mut [f32; 2]
pub fn set_uv1(&mut self, val: [f32; 2]) -> &mut Self
pub fn get_color0(&self) -> [u8; 4]
pub fn get_mut_color0(&mut self) -> &mut [u8; 4]
pub fn set_color0(&mut self, val: [u8; 4]) -> &mut Self
pub fn get_flags(&self) -> u32
pub fn get_mut_flags(&mut self) -> &mut u32
pub fn set_flags(&mut self, val: u32) -> &mut Self
Trait Implementations§
impl Copy for Vertex3D
Source§impl Default for Vertex3D
Default neutral vertex positioned at origin with +Y normal, +X tangent, and white vertex color.
impl Default for Vertex3D
Default neutral vertex positioned at origin with +Y normal, +X tangent, and white vertex color.
impl StructuralPartialEq for Vertex3D
Auto Trait Implementations§
impl Forget for Vertex3D
impl Freeze for Vertex3D
impl Move for Vertex3D
impl RefUnwindSafe for Vertex3D
impl Send for Vertex3D
impl Sync for Vertex3D
impl Unpin for Vertex3D
impl UnsafeUnpin for Vertex3D
impl UnwindSafe for Vertex3D
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