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§
Source§impl Clone for QuadCoordinateConfig
impl Clone for QuadCoordinateConfig
Source§fn clone(&self) -> QuadCoordinateConfig
fn clone(&self) -> QuadCoordinateConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for QuadCoordinateConfig
impl RefUnwindSafe for QuadCoordinateConfig
impl Send for QuadCoordinateConfig
impl Sync for QuadCoordinateConfig
impl Unpin for QuadCoordinateConfig
impl UnwindSafe for QuadCoordinateConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more