Struct ncollide3d::query::RayIntersection
[−]
[src]
pub struct RayIntersection<N: Real> { pub toi: N, pub normal: Vector<N>, pub uvs: Option<Point2<N>>, }
Structure containing the result of a successful ray cast.
Fields
toi: N
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: Vector<N>
The normal at the intersection point.
If the toi
is exactly zero, the normal might not be reliable.
uvs: Option<Point2<N>>
The textures coordinates at the intersection point. This is an Option
because some shape
do not support texture coordinates.
Methods
impl<N: Real> RayIntersection<N>
[src]
pub fn new_with_uvs(
toi: N,
normal: Vector<N>,
uvs: Option<Point2<N>>
) -> RayIntersection<N>
[src]
toi: N,
normal: Vector<N>,
uvs: Option<Point2<N>>
) -> RayIntersection<N>
Creates a new RayIntersection
.
pub fn new(toi: N, normal: Vector<N>) -> RayIntersection<N>
[src]
Creates a new RayIntersection
.