pub struct Ray {
pub pos: Vec3,
pub dir: Vec3,
}
Expand description
A ray.
Fields§
§pos: Vec3
The position of the ray.
dir: Vec3
The direction of the ray.
Implementations§
Source§impl Ray
impl Ray
Sourcepub fn from_2d(
pos: [f64; 2],
draw_size: [u32; 2],
fov: f32,
near_clip: f32,
far_clip: f32,
) -> Ray
pub fn from_2d( pos: [f64; 2], draw_size: [u32; 2], fov: f32, near_clip: f32, far_clip: f32, ) -> Ray
Creates a ray in view coordinates.
Sourcepub fn ground_plane(&self) -> Option<Vec3>
pub fn ground_plane(&self) -> Option<Vec3>
Returns position in ground plane.
Returns None
if looking up above the ground.
Returns None
if ground intersects the start position.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ray
impl RefUnwindSafe for Ray
impl Send for Ray
impl Sync for Ray
impl Unpin for Ray
impl UnwindSafe for Ray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more