[][src]Struct rustbatch::math::raycast::Ray

pub struct Ray {
    pub o: Vect,
    pub v: Vect,
}

Fields

o: Vectv: Vect

Implementations

impl Ray[src]

pub fn new(ox: f32, oy: f32, vx: f32, vy: f32) -> Self[src]

pub fn from_points(a: Vect, b: Vect) -> Self[src]

ray can be also expressed as line from a to b

pub fn is_on(&self, pos: Vect) -> bool[src]

returns whether point belongs to the INFINITE LINE Ray expresses

pub fn within(&self, pos: Vect) -> bool[src]

returns whether point in in AABB this raycast expresses

pub fn contains(&self, pos: Vect) -> bool[src]

combination of within and is_on, if it returns true point belongs to a Ray

pub fn prj_x(&self, x: f32) -> f32[src]

projects x coordinate to y coordinate. This is mainly an helper for intersection calculations

pub fn prj_y(&self, y: f32) -> f32[src]

opposite of prj_x

pub fn project_to_grid(&self, grid_resolution: Vect) -> Self[src]

pub fn inverted(&self) -> Self[src]

returns ray in opposite direction

Trait Implementations

impl Clone for Ray[src]

impl Copy for Ray[src]

impl Debug for Ray[src]

impl Intersection<Circ> for Ray[src]

impl Intersection<Ray> for Rect[src]

fn intersects(&self, o: &Ray) -> bool[src]

returns whether rectangle intersects ray

impl Intersection<Ray> for Circ[src]

impl Intersection<Ray> for Ray[src]

impl Intersection<Rect> for Ray[src]

impl IntersectionPoints<Circ> for Ray[src]

impl IntersectionPoints<Ray> for Rect[src]

fn intersects_points(&self, o: &Ray) -> [Option<Vect>; 2][src]

returns intersection points of rectangle and ray

impl IntersectionPoints<Ray> for Circ[src]

impl IntersectionPoints<Ray> for Ray[src]

impl IntersectionPoints<Rect> for Ray[src]

Auto Trait Implementations

impl RefUnwindSafe for Ray

impl Send for Ray

impl Sync for Ray

impl Unpin for Ray

impl UnwindSafe for Ray

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,