block_mesh/geometry/quad.rs
1/// The minimum voxel and size of a quad, without an orientation. To get the
2/// actual corners of the quad, combine with an [`OrientedBlockFace`].
3///
4/// When using these values for materials and lighting, you can access them
5/// using either the quad's minimum voxel coordinates or the vertex coordinates
6/// given by `OrientedBlockFace::quad_corners`.
7#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8pub struct UnorientedQuad {
9 /// The minimum voxel in the quad.
10 pub minimum: [u32; 3],
11 /// Width of the quad.
12 pub width: u32,
13 /// Height of the quad.
14 pub height: u32,
15}
16
17impl From<UnorientedUnitQuad> for UnorientedQuad {
18 #[inline]
19 fn from(unit: UnorientedUnitQuad) -> Self {
20 Self {
21 minimum: unit.minimum,
22 width: 1,
23 height: 1,
24 }
25 }
26}
27
28/// A quad covering a single voxel (just a single block face), without an
29/// orientation. To get the actual corners of the quad, combine with an
30/// [`OrientedBlockFace`].
31#[derive(Clone, Copy, Debug, Eq, PartialEq)]
32pub struct UnorientedUnitQuad {
33 /// The minimum voxel in the quad.
34 pub minimum: [u32; 3],
35}