Change Scene trait to account for material data
This commit is contained in:
parent
76448ed442
commit
2bc5ec93fe
19 changed files with 306 additions and 124 deletions
|
|
@ -1,6 +1,9 @@
|
|||
use std::cell::OnceCell;
|
||||
|
||||
use crate::triangle_bvh::{BVHMaterial, Triangle, TriangleBVH};
|
||||
use crate::{
|
||||
examples::ExampleSceneEnum,
|
||||
triangle_bvh::{BVHMaterial, Triangle, TriangleBVH},
|
||||
};
|
||||
|
||||
use super::ExampleScene;
|
||||
|
||||
|
|
@ -26,7 +29,7 @@ impl<R: Rng> Default for BasicCornell<R> {
|
|||
}
|
||||
|
||||
impl<R: Rng + 'static> ExampleScene<R> for BasicCornell<R> {
|
||||
fn get_scene(&self) -> Box<dyn Scene<R> + Sync> {
|
||||
fn get_scene(&self) -> ExampleSceneEnum<R> {
|
||||
let s = self.scene.get_or_init(|| {
|
||||
let side_length = 1.5;
|
||||
let light_size = 0.5;
|
||||
|
|
@ -95,7 +98,7 @@ impl<R: Rng + 'static> ExampleScene<R> for BasicCornell<R> {
|
|||
)
|
||||
});
|
||||
|
||||
Box::new(s.clone()) as Box<dyn Scene<R> + Sync>
|
||||
ExampleSceneEnum::TriangleBVH(s.clone())
|
||||
}
|
||||
|
||||
fn get_camera_pos(&self) -> Pos3 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue