Struct dumbmath::quad::Quad2f [] [src]

pub struct Quad2f {
    pub points: (Vec2f, Vec2f, Vec2f, Vec2f),
}

2D Quadrilateral

         top
    p3________p2
     |        |
     |        |
left |        | right
     |        |
     |________|
    p0        p1
       bottom

Fields

points

Methods

impl Quad2f

fn new(a: Vec2f, b: Vec2f, c: Vec2f, d: Vec2f) -> Quad2f

fn iblerp(self, point: Vec2f) -> IBLerpResult

Inverse bilinear interpolation

Adapted from stackoverflow.com/questions/808441

fn inv_bilerp_u(self, point: Vec2f) -> InvBilerpResult

Calculate horizontal parametric coordinate from cartesian point.

fn lerp_bottom(self, u: f32) -> Vec2f

fn lerp_top(self, u: f32) -> Vec2f

fn lerp_left(self, v: f32) -> Vec2f

fn lerp_right(self, v: f32) -> Vec2f

fn blerp(self, uv: Vec2f) -> Vec2f

Trait Implementations

Derived Implementations

impl PartialEq for Quad2f

fn eq(&self, __arg_0: &Quad2f) -> bool

fn ne(&self, __arg_0: &Quad2f) -> bool

impl Debug for Quad2f

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Copy for Quad2f

impl Clone for Quad2f

fn clone(&self) -> Quad2f

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