FVector FMath::LinePlaneIntersection

 inline FVector FMath::LinePlaneIntersection
 	(
 	const FVector &Point1,
 	const FVector &Point2,
 	const FPlane  &Plane
 	)
 {
 	return
 		Point1
 		+	(Point2-Point1)
 		*	((Plane.W - (Point1|Plane))/((Point2 - Point1)|Plane));
 }
该功能还有一个实现,在KismetMathLibrary.h里:
 bool UKismetMathLibrary::LinePlaneIntersection(const FVector& LineStart, const FVector& LineEnd, const FPlane& APlane, float& T, FVector& Intersection)
 {
 	FVector RayDir = LineEnd - LineStart;
 	// Check ray is not parallel to plane
 	if ((RayDir | APlane) == 0.0f)
 	{
 		T = -1.0f;
 		Intersection = FVector::ZeroVector;
 		return false;
 	}
 	T = ((APlane.W - (LineStart | APlane)) / (RayDir | APlane));
 	// Check intersection is not outside line segment
 	if (T < 0.0f || T > 1.0f)
 	{
 		Intersection = FVector::ZeroVector;
 		return false;
 	}
 	// Calculate intersection point
 	Intersection = LineStart + RayDir * T;
 	return true;
 }
这两个实现其实是一样的原理,第二个可以当作第一个实现的详细注释版。
解释一下:其中(Vector | Plane)的操作是合法的,是因为FPlane是FVector的派生类型,因此(Vector | Plane)其实就是向量点乘,具体到这里就是Point点乘(Plane的Normal)。【|】运算符是对FVector.DotProduct的重载
就以Kismet里的蓝图函数来说: