Struct rs_pbrt::core::reflection::Bsdf

source ·
pub struct Bsdf {
    pub eta: Float,
    pub ns: Normal3f,
    pub ng: Normal3f,
    pub ss: Vector3f,
    pub ts: Vector3f,
    pub bxdfs: Vec<Bxdf>,
}

Fields§

§eta: Float§ns: Normal3f

shading normal

§ng: Normal3f

geometric normal

§ss: Vector3f§ts: Vector3f§bxdfs: Vec<Bxdf>

Implementations§

source§

impl Bsdf

source

pub fn new(si: &SurfaceInteraction<'_>, eta: Float) -> Self

source

pub fn add(&mut self, b: Bxdf)

source

pub fn num_components(&self, flags: u8) -> u8

source

pub fn world_to_local(&self, v: &Vector3f) -> Vector3f

source

pub fn local_to_world(&self, v: &Vector3f) -> Vector3f

source

pub fn f(&self, wo_w: &Vector3f, wi_w: &Vector3f, flags: u8) -> Spectrum

source

pub fn sample_f( &self, wo_world: &Vector3f, wi_world: &mut Vector3f, u: &Point2f, pdf: &mut Float, bsdf_flags: u8, sampled_type: &mut u8 ) -> Spectrum

Calls the individual Bxdf::sample_f() methods to generate samples.

source

pub fn pdf( &self, wo_world: &Vector3f, wi_world: &Vector3f, bsdf_flags: u8 ) -> Float

Trait Implementations§

source§

impl Clone for Bsdf

source§

fn clone(&self) -> Bsdf

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Bsdf

§

impl Send for Bsdf

§

impl Sync for Bsdf

§

impl Unpin for Bsdf

§

impl !UnwindSafe for Bsdf

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.