pub struct Glass {
pub index: f32,
pub thickness: f32,
pub tint: Color,
}Expand description
How glass bends and tints the scene behind it.
Fields§
§index: f32The refractive index: 1 bends nothing, window glass is 1.5 and diamond 2.4.
thickness: f32How far a ray travels inside the glass, in scene units: a ball’s diameter for a solid ball. A ray bends entering the glass and again leaving it, as through a solid ball, so a thick ball shows the scene behind it upside down.
tint: ColorThe colour the glass tints what shows through it; white for clear glass.
Implementations§
Trait Implementations§
impl Copy for Glass
impl StructuralPartialEq for Glass
Auto Trait Implementations§
impl Freeze for Glass
impl RefUnwindSafe for Glass
impl Send for Glass
impl Sync for Glass
impl Unpin for Glass
impl UnsafeUnpin for Glass
impl UnwindSafe for Glass
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more