Fix all warnings
This commit is contained in:
parent
2bc5ec93fe
commit
ae4dc2c21a
26 changed files with 249 additions and 185 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue