Fix all warnings

This commit is contained in:
hal8174 2025-08-23 13:36:07 +02:00
parent 2bc5ec93fe
commit ae4dc2c21a
Signed by: hal8174
SSH key fingerprint: SHA256:NN98ZYwnrreQLSOV/g+amY7C3yL/mS1heD7bi5t6PPw
26 changed files with 249 additions and 185 deletions

View file

@ -1,5 +1,5 @@
use crate::prelude::*;
use std::fmt::Debug;
use std::{fmt::Debug, ops::Deref};
/// Trait to model bxdf.
///
@ -55,6 +55,20 @@ impl<R: Rng, M: Material<R>> Material<R> for &M {
}
}
impl<R: Rng> Material<R> for std::sync::Arc<dyn Material<R>> {
fn eval(&self, w_in: Dir3, w_out: Dir3, rng: &mut R) -> Color {
self.deref().eval(w_in, w_out, rng)
}
fn sample(&self, w_in: Dir3, rng: &mut R) -> SampleResult {
self.deref().sample(w_in, rng)
}
fn pdf(&self, w_in: Dir3, w_out: Dir3) -> Float {
self.deref().pdf(w_in, w_out)
}
}
#[derive(Debug)]
pub struct SampleResult {
w_out: Dir3,

View file

@ -1,6 +1,6 @@
use crate::prelude::*;
use core::panic;
use std::ops::{Add, Index, Mul, Sub};
use std::ops::{Add, Index, Sub};
#[derive(Debug, Clone, Copy)]
pub struct Pos3 {