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 OThe object that was hit by the ray.
near: NThe 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: NThe 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>
source§impl<'a, O: PartialEq, N: PartialEq> PartialEq<RaycastHit<'a, O, N>> for RaycastHit<'a, O, N>
impl<'a, O: PartialEq, N: PartialEq> PartialEq<RaycastHit<'a, O, N>> for RaycastHit<'a, O, N>
source§fn eq(&self, other: &RaycastHit<'a, O, N>) -> bool
fn eq(&self, other: &RaycastHit<'a, O, N>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.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> StructuralEq for RaycastHit<'a, O, N>
impl<'a, O, N> StructuralPartialEq for RaycastHit<'a, O, N>
Auto Trait Implementations§
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>where N: Send, O: Sync,
impl<'a, O, N> Sync for RaycastHit<'a, O, N>where N: Sync, O: Sync,
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