Archive 17/01/2023.

Intersection between a plane and a ray

Vivek

I am trying to build a to drag a 3d model over a plane. How do i find the intersection point between a ray cast and virtual plane.
I have not found any rayscene query for a virtual plane.

cadaver

You should be able to use this member function in Ray. It returns the distance along the ray, from which you can calculate the hit position.

/// Return hit distance to a plane, or infinity if no hit.
float HitDistance(const Plane& plane) const;

Note that on AngelScript you’d need to pull the latest master, binding for that function was missing and was just added.

Vivek

works, thank you