pub struct PathTracerScene {
pub spheres: Vec<Sphere>,
pub triangles: Vec<Triangle>,
pub lights: Vec<PointLight>,
pub materials: Vec<Material>,
pub sky_top: [f32; 3],
pub sky_bottom: [f32; 3],
}Expand description
A scene containing geometry, materials, and lights.
Fields§
§spheres: Vec<Sphere>Sphere primitives in the scene.
triangles: Vec<Triangle>Triangle primitives in the scene.
lights: Vec<PointLight>Point lights in the scene.
materials: Vec<Material>Material list shared by all primitives.
sky_top: [f32; 3]Background (sky) gradient top colour.
sky_bottom: [f32; 3]Background (sky) gradient bottom colour.
Implementations§
Source§impl PathTracerScene
impl PathTracerScene
Sourcepub fn add_material(&mut self, mat: Material) -> usize
pub fn add_material(&mut self, mat: Material) -> usize
Add a material and return its index.
Sourcepub fn add_sphere(&mut self, sphere: Sphere)
pub fn add_sphere(&mut self, sphere: Sphere)
Add a sphere to the scene.
Sourcepub fn add_triangle(&mut self, triangle: Triangle)
pub fn add_triangle(&mut self, triangle: Triangle)
Add a triangle to the scene.
Sourcepub fn add_light(&mut self, light: PointLight)
pub fn add_light(&mut self, light: PointLight)
Add a point light to the scene.
Trait Implementations§
Source§impl Clone for PathTracerScene
impl Clone for PathTracerScene
Source§fn clone(&self) -> PathTracerScene
fn clone(&self) -> PathTracerScene
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 moreSource§impl Debug for PathTracerScene
impl Debug for PathTracerScene
Source§impl Default for PathTracerScene
impl Default for PathTracerScene
Source§fn default() -> PathTracerScene
fn default() -> PathTracerScene
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PathTracerScene
impl RefUnwindSafe for PathTracerScene
impl Send for PathTracerScene
impl Sync for PathTracerScene
impl Unpin for PathTracerScene
impl UnsafeUnpin for PathTracerScene
impl UnwindSafe for PathTracerScene
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,
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