SG_PLANE_AND_LINE sgSpaceMath::IntersectPlaneAndLine(const SG_VECTOR& planeNorm, const double planeD, const SG_POINT& lineP, const SG_VECTOR& lineDir, SG_POINT& resP)

Description:

Calculates the positional relationship of the line and the plane. If they are intersecting the function returns the point of intersection.

Arguments:

planeNorm - normal to the plane,

planeD - free coefficient in the plane equation,

lineP - point on the line,

lineDir - direction vector of the line,

resP - the found intersection point of the line and the plane

Returned value:

One of the following values is returned:

SG_LINE_PARALLEL - if the line is parallel to the plane and lie on it, the resP value won't be changed,

SG_LINE_ON_PLANE - if the line lies on the plane, the resP value won't be changed,

SG_EXIST_INTERSECT_PONT - if the line and the plane are intersecting, resP will be the point of intersection.

See also:

SG_POINT SG_VECTOR Finding plane by three points Finding plane by normal and point