[][src]Struct building_blocks_mesh::greedy_quads::Quad

pub struct Quad {
    pub minimum: Point3i,
    pub width: i32,
    pub height: i32,
}

A single quad of connected cubic voxel faces. Must belong to a QuadGroup to be useful.

Fields

minimum: Point3iwidth: i32height: i32

Implementations

impl Quad[src]

pub fn simple_tex_coords(&self) -> [[f32; 2]; 4][src]

Returns the UV coordinates of the 4 corners of the quad. Returns in the same order as QuadGroup::quad_corners.

This is just one way of assigning UVs to voxel quads. It assumes that each material has a single tile texture with wrapping coordinates, and each voxel face should show the entire texture. It also assumes a particular orientation for the texture. This should be sufficient for minecraft-style meshing.

If you need to use a texture atlas, you must calculate your own coordinates from the Quad.

Trait Implementations

impl Clone for Quad[src]

impl Copy for Quad[src]

impl Debug for Quad[src]

impl Eq for Quad[src]

impl PartialEq<Quad> for Quad[src]

impl StructuralEq for Quad[src]

impl StructuralPartialEq for Quad[src]

Auto Trait Implementations

impl RefUnwindSafe for Quad

impl Send for Quad

impl Sync for Quad

impl Unpin for Quad

impl UnwindSafe for Quad

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.