pub struct GltfMeshWriter {
pub vertices: Vec<[f64; 3]>,
pub normals: Vec<[f64; 3]>,
pub uvs: Vec<[f64; 2]>,
pub indices: Vec<[u32; 3]>,
pub material_name: String,
}Expand description
Write a mesh to glTF 2.0 format (JSON + binary buffer).
Fields§
§vertices: Vec<[f64; 3]>Vertex positions.
normals: Vec<[f64; 3]>Vertex normals.
uvs: Vec<[f64; 2]>UV texture coordinates.
indices: Vec<[u32; 3]>Triangle indices.
material_name: StringMaterial name.
Implementations§
Source§impl GltfMeshWriter
impl GltfMeshWriter
Sourcepub fn new(
vertices: Vec<[f64; 3]>,
normals: Vec<[f64; 3]>,
uvs: Vec<[f64; 2]>,
indices: Vec<[u32; 3]>,
) -> Self
pub fn new( vertices: Vec<[f64; 3]>, normals: Vec<[f64; 3]>, uvs: Vec<[f64; 2]>, indices: Vec<[u32; 3]>, ) -> Self
Construct with mesh data.
Sourcepub fn positions_f32_bytes(&self) -> Vec<u8> ⓘ
pub fn positions_f32_bytes(&self) -> Vec<u8> ⓘ
Pack positions as f32 little-endian bytes.
Sourcepub fn indices_u32_bytes(&self) -> Vec<u8> ⓘ
pub fn indices_u32_bytes(&self) -> Vec<u8> ⓘ
Pack indices as u32 little-endian bytes.
Auto Trait Implementations§
impl Freeze for GltfMeshWriter
impl RefUnwindSafe for GltfMeshWriter
impl Send for GltfMeshWriter
impl Sync for GltfMeshWriter
impl Unpin for GltfMeshWriter
impl UnsafeUnpin for GltfMeshWriter
impl UnwindSafe for GltfMeshWriter
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.