[][src]Struct tray_rust::geometry::rectangle::Rectangle

pub struct Rectangle { /* fields omitted */ }

A rectangle centered at the origin spanning [-width / 2, -height / 2] to [width / 2, height / 2] with a normal along [0, 0, 1]

Methods

impl Rectangle[src]

pub fn new(width: f32, height: f32) -> Rectangle[src]

Create a new rectangle with the desired width and height

Trait Implementations

impl Geometry for Rectangle[src]

impl Boundable for Rectangle[src]

impl Sampleable for Rectangle[src]

fn sample_uniform(&self, samples: &(f32, f32)) -> (Point, Normal)[src]

Uniform sampling for a rect is simple: just scale the two samples into the rectangle's space and return them as the x,y coordinates of the point chosen

fn surface_area(&self) -> f32[src]

Compute the sphere's surface area

fn pdf(&self, p: &Point, w_i: &Vector) -> f32[src]

Compute the PDF that the ray from p with direction w_i intersects the shape. This is the same as disk for computing PDF, we just use the rectangle's surface area instead

impl Clone for Rectangle[src]

impl Copy for Rectangle[src]

Auto Trait Implementations

impl Send for Rectangle

impl Sync for Rectangle

impl Unpin for Rectangle

impl UnwindSafe for Rectangle

impl RefUnwindSafe for Rectangle

Blanket Implementations

impl<T> BoundableGeom for T where
    T: Geometry + Boundable + ?Sized
[src]

impl<T> SampleableGeom for T where
    T: Geometry + Boundable + Sampleable + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T[src]