pub struct ShapeCastHit {
pub body: BodyHandle,
pub toi: f32,
pub point: [f32; 3],
pub normal: [f32; 3],
pub gap: f32,
pub started_touching: bool,
}Expand description
What a ShapeCast ran into.
Fields§
§body: BodyHandleThe body that was hit.
toi: f32Fraction of the cast’s motion covered before the contact, in
[0, 1]. Multiply the motion by it to get the safe displacement.
point: [f32; 3]World-space contact point on the body that was hit.
normal: [f32; 3]Unit-length normal on the body that was hit, pointing back toward the swept shape. This is the direction to slide along.
gap: f32Distance between the two surfaces where the sweep stopped: zero or a
hair positive for a shape that stopped short of the body, negative for
one that began inside it. Separating along normal by -gap is what
clears the overlap.
started_touching: boolWhether the shape was already touching this body before it moved. A
caller that slides along normal has to separate first, or it will be
handed the same zero-length move again.
Trait Implementations§
Source§impl Clone for ShapeCastHit
impl Clone for ShapeCastHit
Source§fn clone(&self) -> ShapeCastHit
fn clone(&self) -> ShapeCastHit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ShapeCastHit
Auto Trait Implementations§
impl Freeze for ShapeCastHit
impl RefUnwindSafe for ShapeCastHit
impl Send for ShapeCastHit
impl Sync for ShapeCastHit
impl Unpin for ShapeCastHit
impl UnsafeUnpin for ShapeCastHit
impl UnwindSafe for ShapeCastHit
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