Struct valence_spatial::RaycastHit
source · pub struct RaycastHit<'a, O, N = f64> {
pub object: &'a O,
pub near: N,
pub far: N,
}
Expand description
Represents an intersection between a ray and an entity’s axis-aligned bounding box (hitbox).
Fields§
§object: &'a O
The object that was hit by the ray.
near: N
The distance from the ray origin to the closest intersection point. If the origin of the ray is inside the bounding box, then this will be zero.
far: N
The distance from the ray origin to the second intersection point. This represents the point at which the ray exits the bounding box.
Trait Implementations§
source§impl<O, N: Clone> Clone for RaycastHit<'_, O, N>
impl<O, N: Clone> Clone for RaycastHit<'_, O, N>
impl<O, N: Copy> Copy for RaycastHit<'_, O, N>
impl<'a, O: Eq, N: Eq> Eq for RaycastHit<'a, O, N>
impl<'a, O, N> StructuralPartialEq for RaycastHit<'a, O, N>
Auto Trait Implementations§
impl<'a, O, N> Freeze for RaycastHit<'a, O, N>where
N: Freeze,
impl<'a, O, N> RefUnwindSafe for RaycastHit<'a, O, N>where
N: RefUnwindSafe,
O: RefUnwindSafe,
impl<'a, O, N> Send for RaycastHit<'a, O, N>
impl<'a, O, N> Sync for RaycastHit<'a, O, N>
impl<'a, O, N> Unpin for RaycastHit<'a, O, N>where
N: Unpin,
impl<'a, O, N> UnwindSafe for RaycastHit<'a, O, N>where
N: UnwindSafe,
O: RefUnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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