[−][src]Struct rustbatch::math::raycast::Ray
Fields
o: Vect
v: 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]
fn intersects(&self, o: &Circ) -> bool
[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]
fn intersects(&self, o: &Ray) -> bool
[src]
impl Intersection<Ray> for Ray
[src]
fn intersects(&self, o: &Ray) -> bool
[src]
impl Intersection<Rect> for Ray
[src]
fn intersects(&self, o: &Rect) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,