pub type RayIntersection = RayIntersection;
Expand description

The intersection between a ray and a collider.

Aliased Type§

struct RayIntersection {
    pub toi: f32,
    pub normal: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>,
    pub feature: FeatureId,
}

Fields§

§toi: f32

The time of impact of the ray with the object. The exact contact point can be computed with: ray.point_at(toi) or equivalently origin + dir * toi where origin is the origin of the ray; dir is its direction and toi is the value of this field.

§normal: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>

The normal at the intersection point.

If the toi is exactly zero, the normal might not be reliable.

§feature: FeatureId

Feature at the intersection point.