easy_gltf/scene/model/
vertex.rs1use cgmath::*;
2
3pub type Triangle = [Vertex; 3];
5
6pub type Line = [Vertex; 2];
8
9#[repr(C)]
11#[derive(Clone, Copy, Debug, PartialEq)]
12pub struct Vertex {
13 pub position: Vector3<f32>,
15 pub normal: Vector3<f32>,
17 pub tangent: Vector4<f32>,
20 pub tex_coords: Vector2<f32>,
22 #[cfg(feature = "vertex-color")]
24 pub color: Vector4<u16>, }
26
27impl Default for Vertex {
28 fn default() -> Self {
29 Vertex {
30 position: Zero::zero(),
31 normal: Zero::zero(),
32 tangent: Zero::zero(),
33 tex_coords: Zero::zero(),
34 #[cfg(feature = "vertex-color")]
35 color: Vector4::new(1, 1, 1, 1),
36 }
37 }
38}