[][src]Struct tray_rust::geometry::differential_geometry::DifferentialGeometry

pub struct DifferentialGeometry<'a> {
    pub p: Point,
    pub n: Normal,
    pub ng: Normal,
    pub u: f32,
    pub v: f32,
    pub time: f32,
    pub dp_du: Vector,
    pub dp_dv: Vector,
    pub geom: &'a (dyn Geometry + 'a),
}

Stores information about a hit piece of geometry of some object in the scene

Fields

p: Point

The hit point

n: Normal

The shading normal

ng: Normal

The geometry normal

u: f32

Surface parameterization u, v for texture mapping

v: f32time: f32

The intersection time

dp_du: Vector

Derivative of the point with respect to the u parameterization coord of the surface

dp_dv: Vector

Derivative of the point with respect to the v parameterization coord of the surface

geom: &'a (dyn Geometry + 'a)

The geometry that was hit

Methods

impl<'a> DifferentialGeometry<'a>[src]

pub fn new(
    p: &Point,
    ng: &Normal,
    u: f32,
    v: f32,
    time: f32,
    dp_du: &Vector,
    dp_dv: &Vector,
    geom: &'a (dyn Geometry + 'a)
) -> DifferentialGeometry<'a>
[src]

Setup the differential geometry. Note that the normal will be computed using cross(dp_du, dp_dv)

pub fn with_normal(
    p: &Point,
    n: &Normal,
    u: f32,
    v: f32,
    time: f32,
    dp_du: &Vector,
    dp_dv: &Vector,
    geom: &'a (dyn Geometry + 'a)
) -> DifferentialGeometry<'a>
[src]

Setup the differential geometry using the normal passed for the surface normal

Trait Implementations

impl<'a> Clone for DifferentialGeometry<'a>[src]

impl<'a> Copy for DifferentialGeometry<'a>[src]

Auto Trait Implementations

impl<'a> !Send for DifferentialGeometry<'a>

impl<'a> !Sync for DifferentialGeometry<'a>

impl<'a> Unpin for DifferentialGeometry<'a>

impl<'a> !UnwindSafe for DifferentialGeometry<'a>

impl<'a> !RefUnwindSafe for DifferentialGeometry<'a>

Blanket Implementations

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]