Struct ark_api::world::RaycastHit
source · [−]#[repr(C)]pub struct RaycastHit {
pub point: Vec3,
pub distance: f32,
pub normal: Vec3,
pub entity: Entity,
}
Expand description
A single hit from a raycast query.
Fields
point: Vec3
Point in world space that was hit.
This could technically be calculated by using the original ray together with the distance
field.
But that would require callers to keep track of their query object and also ensure their ray directions are normalized
which is not as convenient.
distance: f32
The distance along the ray.
The hits are sorted by this distance when returned from raycast and spherecast queries.
In a raycast this is equal to ray.origin.distance(hit.position)
,
but in a spherecast it can be different.
normal: Vec3
World space normal of the surface that was hit.
entity: Entity
Entity that was hit.
Trait Implementations
sourceimpl Clone for RaycastHit
impl Clone for RaycastHit
sourcefn clone(&self) -> RaycastHit
fn clone(&self) -> RaycastHit
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RaycastHit
impl Debug for RaycastHit
impl Copy for RaycastHit
Auto Trait Implementations
impl RefUnwindSafe for RaycastHit
impl Send for RaycastHit
impl Sync for RaycastHit
impl Unpin for RaycastHit
impl UnwindSafe for RaycastHit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more