Struct block_mesh::QuadCoordinateConfig
source · [−]pub struct QuadCoordinateConfig {
pub faces: [OrientedBlockFace; 6],
pub u_flip_face: Axis,
}
Expand description
A configuration of XYZ –> NUV axis mappings and orientations of the cube faces for a given coordinate system.
See the geometry
module documentation for more
information on {N, U, V}
space.
Fields
faces: [OrientedBlockFace; 6]
u_flip_face: Axis
For a given coordinate system, one of the two axes that isn’t UP must be
flipped in the U texel coordinate direction to avoid incorrect texture
mirroring. For example, in a right-handed coordinate system with +Y
pointing up, you should set u_flip_face
to Axis::X
, because those
faces need their U coordinates to be flipped relative to the other
faces:
+X face O
+Z face / |
^ O--------O ^ O |
| | | | | |
+V | | | +V | | O ^
| | | | | / /
| O--------O | O /
------------ > | / +U
+U
+Y
| -Z
-X____|/____+X
/|
+Z |
-Y
As you can see, for the +Z face, +U is toward positive X. But for the +X face, +U is towards negative Z.
Trait Implementations
sourceimpl Clone for QuadCoordinateConfig
impl Clone for QuadCoordinateConfig
sourcefn clone(&self) -> QuadCoordinateConfig
fn clone(&self) -> QuadCoordinateConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for QuadCoordinateConfig
impl Send for QuadCoordinateConfig
impl Sync for QuadCoordinateConfig
impl Unpin for QuadCoordinateConfig
impl UnwindSafe for QuadCoordinateConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more