RealDocs

UKismetMathLibrary::LinePlaneIntersection_OriginNormal

function Engine Blueprint Since unknown
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Finds the point where a line segment crosses a plane, with the plane specified as an origin point and normal instead of an FPlane. This is the origin/normal overload of LinePlaneIntersection.

Caveats & Gotchas

  • PlaneNormal must be normalized — an un-normalized normal produces an incorrect T and Intersection without any warning.
  • In Blueprint this appears as "Line Plane Intersection (Origin & Normal)" via a DisplayName override, which is often easier to wire up than constructing an FPlane by hand.
  • As with the FPlane overload, T can be outside [0, 1] if the intersection lies beyond the segment's endpoints; check the range before trusting the hit as being on the segment.

Signature

static bool LinePlaneIntersection_OriginNormal(const FVector& LineStart, const FVector& LineEnd, FVector PlaneOrigin, FVector PlaneNormal, float& T, FVector& Intersection)

Parameters

Name Type Description Default
LineStart const FVector& Start point of the line segment.
LineEnd const FVector& End point of the line segment.
PlaneOrigin FVector Any point on the plane.
PlaneNormal FVector Unit normal vector of the plane.
T float& Receives the interpolation factor along the line where the intersection occurs (0 = LineStart, 1 = LineEnd).
Intersection FVector& Receives the world-space point of intersection.

Return Type

bool

Example

Project a point onto a mirror plane C++
float T;
FVector Intersection;
bool bHit = UKismetMathLibrary::LinePlaneIntersection_OriginNormal(RayStart, RayEnd, MirrorActor->GetActorLocation(), MirrorActor->GetActorForwardVector(), T, Intersection);

Tags

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.