pub struct ShapeHit {
pub t: f64,
pub point: DVec3,
pub normal: DVec3,
pub started_inside: bool,
pub part: usize,
}Expand description
The result of a ray or sweep query against a single shape.
Fields§
§t: f64Parametric distance along the ray at the hit point.
point: DVec3World-space position of the hit.
normal: DVec3Unit normal at the hit point, pointing away from the surface the ray struck. For swept-sphere queries this is the contact normal.
started_inside: boolWhether the query’s accepted interval begins inside the shape — for
a ray that is origin + dir * t_min, for a sweep the sweep’s start
position. A hit with this set is a resolution case (push out), not an
approach.
part: usizeWhich part of the collider was struck: for a compound
(crate::PhysicsWorld::add_compound) the index of the part in its
CompoundShape::parts, and 0 for
every other collider and from every shape-level function here.
Trait Implementations§
impl Copy for ShapeHit
impl StructuralPartialEq for ShapeHit
Auto Trait Implementations§
impl Forget for ShapeHit
impl Freeze for ShapeHit
impl Move for ShapeHit
impl RefUnwindSafe for ShapeHit
impl Send for ShapeHit
impl Sync for ShapeHit
impl Unpin for ShapeHit
impl UnsafeUnpin for ShapeHit
impl UnwindSafe for ShapeHit
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