Skip to main content

MeshData

Struct MeshData 

Source
pub struct MeshData {
    pub name: Option<String>,
    pub positions: Vec<[f32; 3]>,
    pub normals: Vec<[f32; 3]>,
    pub uvs: Vec<Vec<[f32; 2]>>,
    pub submeshes: Vec<SubmeshData>,
}
Expand description

A Unity-shaped mesh ready for export. All data is in Unity’s left-handed coordinate system; the build step inverts handedness to produce right-handed glTF output.

Fields§

§name: Option<String>

Mesh name, or None to omit from the glTF output.

§positions: Vec<[f32; 3]>

Vertex positions. Tightly packed [x, y, z] floats (Unity space, X negated vs glTF).

§normals: Vec<[f32; 3]>

Vertex normals, same length as positions. Empty if the mesh has no normals.

§uvs: Vec<Vec<[f32; 2]>>

UV channels. uvs[k] holds all vertices for TEXCOORD_k (Unity bottom-left origin, V will be flipped during the build step).

§submeshes: Vec<SubmeshData>

One sub-mesh per glTF primitive.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.