Struct ncollide::query::RayIntersection
[−]
[src]
pub struct RayIntersection<V> where
V: Vector, { pub toi: <V as InnerSpace>::Real, pub normal: V, pub uvs: Option<Point<<V as InnerSpace>::Real, U2>>, }
Structure containing the result of a successful ray cast.
Fields
toi: <V as InnerSpace>::Real
The time of impact of the ray with the object. The exact contact point can be computed
with: origin + dir * toi
where origin
is the origin of the ray; dir
is its direction and
toi
is the value of this field.
normal: V
The normal at the intersection point.
If the toi
is exactly zero, the normal might not be reliable.
uvs: Option<Point<<V as InnerSpace>::Real, U2>>
The textures coordinates at the intersection point. This is an Option
because some shape
do not support texture coordinates.
Methods
impl<V> RayIntersection<V> where
V: Vector,
[src]
V: Vector,
fn new_with_uvs(
toi: <V as InnerSpace>::Real,
normal: V,
uvs: Option<Point<<V as InnerSpace>::Real, U2>>
) -> RayIntersection<V>
toi: <V as InnerSpace>::Real,
normal: V,
uvs: Option<Point<<V as InnerSpace>::Real, U2>>
) -> RayIntersection<V>
Creates a new RayIntersection
.
fn new(toi: <V as InnerSpace>::Real, normal: V) -> RayIntersection<V>
Creates a new RayIntersection
.