[−][src]Struct vek::geom::repr_c::Ray
3D ray, represented by a starting point and a normalized direction vector.
Fields
origin: Vec3<T>
The ray's starting point.
direction: Vec3<T>
The ray's direction. Methods expect it to be normalized.
Methods
impl<T: Real + Sum> Ray<T>
[src]
pub fn new(origin: Vec3<T>, direction: Vec3<T>) -> Self
[src]
Creates a Ray
from a starting point and direction.
This doesn't check if direction
is normalized, because either you know it is, or
it isn't and maybe it doesn't matter for your use case.
pub fn triangle_intersection(&self, tri: [Vec3<T>; 3]) -> Option<T>
[src]
Tests if this ray intersects the given triangle, returning the distance from the ray's origin along its direction where the intersection lies.
If the returned value is Some(x)
where x < EPSILON
, then you should
assume there was a line intersection, NOT a ray intersection.
This uses the Möller–Trumbore intersection algorithm.
Trait Implementations
impl<T: Debug> Debug for Ray<T>
[src]
impl<T: PartialEq> PartialEq<Ray<T>> for Ray<T>
[src]
impl<T: Eq> Eq for Ray<T>
[src]
impl<T: Hash> Hash for Ray<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Copy> Copy for Ray<T>
[src]
impl<T: Clone> Clone for Ray<T>
[src]
fn clone(&self) -> Ray<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Default> Default for Ray<T>
[src]
Auto Trait Implementations
impl<T> Unpin for Ray<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for Ray<T> where
T: Sync,
T: Sync,
impl<T> Send for Ray<T> where
T: Send,
T: Send,
impl<T> UnwindSafe for Ray<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Ray<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,