pub struct Normal {
pub place: Place,
pub encoding: NormalEncoding,
pub space: NormalSpace,
}Expand description
The surface’s normal: its place, how its lanes store it and the space it is in.
Fields§
§place: PlaceThe lanes the normal is stored in.
encoding: NormalEncodingHow the lanes encode the normal.
space: NormalSpaceThe space the decoded normal is in.
Implementations§
Source§impl Normal
impl Normal
Sourcepub fn width(encoding: NormalEncoding) -> u32
pub fn width(encoding: NormalEncoding) -> u32
The lanes its encoding stores the normal in.
Sourcepub fn vector(&self, values: [f32; 4]) -> [f32; 3]
pub fn vector(&self, values: [f32; 4]) -> [f32; 3]
The vector the lanes store, out of the four values of its output, as the encoding gives it back: the three
stored components unbiased (Xyz, XyzUnorm, XyzBiased), which a program need not have written at unit length;
the unit vector of the encodings that make one (the two-lane, octahedral and cube-face ones).
A cube face is taken as the nearest axis to lane 3 and the side of one half lane 2 is on, without
NormalEncoding::decode_cube_face’s refusal of lanes between them, which needs the target’s quantisation step;
the payloads beside a normal (the diamond layout’s and the cube face’s) are not part of it.
Trait Implementations§
impl Copy for Normal
impl Eq for Normal
impl StructuralPartialEq for Normal
Auto Trait Implementations§
impl Forget for Normal
impl Freeze for Normal
impl RefUnwindSafe for Normal
impl Send for Normal
impl Sync for Normal
impl Unpin for Normal
impl UnsafeUnpin for Normal
impl UnwindSafe for Normal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.