pub type ShapeCastHit = ShapeCastHit;Expand description
The result of a shape-cast between two shapes.
Aliased Type§
pub struct ShapeCastHit {
pub time_of_impact: f32,
pub witness1: OPoint<f32, Const<3>>,
pub witness2: OPoint<f32, Const<3>>,
pub normal1: Unit<Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>>,
pub normal2: Unit<Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>>,
pub status: ShapeCastStatus,
}Fields§
§time_of_impact: f32The time at which the objects touch.
witness1: OPoint<f32, Const<3>>The local-space closest point on the first shape at the time of impact.
This value is unreliable if status is [ShapeCastStatus::PenetratingOrWithinTargetDist]
and [ShapeCastOptions::compute_impact_geometry_on_penetration] was set to false.
witness2: OPoint<f32, Const<3>>The local-space closest point on the second shape at the time of impact.
This value is unreliable if status is [ShapeCastStatus::PenetratingOrWithinTargetDist]
and both [ShapeCastOptions::compute_impact_geometry_on_penetration] was set to false
when calling the time-of-impact function.
normal1: Unit<Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>>The local-space outward normal on the first shape at the time of impact.
This value is unreliable if status is [ShapeCastStatus::PenetratingOrWithinTargetDist]
and both [ShapeCastOptions::compute_impact_geometry_on_penetration] was set to false
when calling the time-of-impact function.
normal2: Unit<Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>>The local-space outward normal on the second shape at the time of impact.
This value is unreliable if status is [ShapeCastStatus::PenetratingOrWithinTargetDist]
and both [ShapeCastOptions::compute_impact_geometry_on_penetration] was set to false
when calling the time-of-impact function.
status: ShapeCastStatusThe way the shape-casting algorithm terminated.