From 44b46187a045035daf54f5ace55fb95d8cc775cf Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Wed, 21 Jul 2021 20:45:33 -0700 Subject: [PATCH] world: add builder pattern. --- rtchallenge/src/world.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rtchallenge/src/world.rs b/rtchallenge/src/world.rs index 7aecc54..5db015e 100644 --- a/rtchallenge/src/world.rs +++ b/rtchallenge/src/world.rs @@ -1,3 +1,5 @@ +use derive_builder::Builder; + use crate::{ intersections::{prepare_computations, Intersections, PrecomputedData}, lights::PointLight, @@ -20,7 +22,8 @@ use crate::{ /// assert_eq!(w.lights.len(), 0); /// ``` -#[derive(Clone, Debug, Default)] +#[derive(Builder, Clone, Debug, Default)] +#[builder(default)] pub struct World { pub lights: Vec, pub objects: Vec,