gltforge_unity_export/mesh_data.rs
1use crate::submesh_data::SubmeshData;
2
3/// A Unity-shaped mesh ready for export.
4/// All data is in Unity's left-handed coordinate system; the build step inverts
5/// handedness to produce right-handed glTF output.
6pub struct MeshData {
7 /// Mesh name, or `None` to omit from the glTF output.
8 pub name: Option<String>,
9
10 /// Vertex positions. Tightly packed `[x, y, z]` floats (Unity space, X negated vs glTF).
11 pub positions: Vec<[f32; 3]>,
12
13 /// Vertex normals, same length as `positions`. Empty if the mesh has no normals.
14 pub normals: Vec<[f32; 3]>,
15
16 /// UV channels. `uvs[k]` holds all vertices for `TEXCOORD_k` (Unity bottom-left origin, V
17 /// will be flipped during the build step).
18 pub uvs: Vec<Vec<[f32; 2]>>,
19
20 /// One sub-mesh per glTF primitive.
21 pub submeshes: Vec<SubmeshData>,
22}