FMath::LineBoxIntersection

Determines whether a line intersects a box.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h

Include

#include "Math/UnrealMathUtility.h"

Source

/Engine/Source/Runtime/Core/Public/Math/Box.h

Syntax

template<typename FReal>
static bool LineBoxIntersection
(
    const UE::Math::TBox< FReal > & Box,
    const UE::Math::TVector< FReal > & Start,
    const UE::Math::TVector< FReal > & End,
    const UE::Math::TVector< FReal > & Direction,
    const UE::Math::TVector< FReal > & OneOverDirection
)

Remarks

Determines whether a line intersects a box. This overload avoids the need to do the reciprocal every time.