Navigation
API > API/Runtime > API/Runtime/Core
| Name | TRay |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Math/MathFwd.h |
| Include Path | #include "Math/MathFwd.h" |
| Source | /Engine/Source/Runtime/Core/Public/Math/Ray.h |
Syntax
template<typename T>
struct TRay
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TRay () |
Default constructor initializes ray to Zero origin and Z-axis direction | Math/Ray.h | |
TRay
(
EForceInit |
Creates and initializes a new Ray to Zero Origin and Z-axis Direction. | Math/Ray.h | |
| Conversion to other type. | Math/Ray.h | ||
| Initialize Ray with origin and direction | Math/Ray.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FReal | T | Math/Ray.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Direction | TVector< T > | Ray direction vector (always normalized) | Math/Ray.h | |
| Origin | TVector< T > | Ray origin point | Math/Ray.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Find closest point on ray to query point | Math/Ray.h | ||
T Dist
(
const TVector< T >& Point |
Find minimum distance from query point to ray | Math/Ray.h | |
T DistSquared
(
const TVector< T >& Point |
Find minimum squared distance from query point to ray | Math/Ray.h | |
T GetParameter
(
const TVector< T >& Point |
Calculate ray parameter (distance from origin to closest point) for query Point | Math/Ray.h | |
void Init() |
Set the initial values of the Ray to Zero Origin and Z-axis Direction. | Math/Ray.h | |
TVector< T > PointAt
(
T RayParameter |
Calculate position on ray at given distance/parameter | Math/Ray.h | |
bool Serialize
(
FArchive& Ar |
Note: TRay is usually written via binary serialization. This function exists for SerializeFromMismatchedTag conversion usage. | Math/Ray.h | |
| Math/Ray.h | |||
FString ToString() |
Get a textual representation of the Ray. | Math/Ray.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const TRay< T >& Other |
Compares two Rays for inequality. | Math/Ray.h | |
bool operator==
(
const TRay< T >& Other |
Compares two Rays for equality. | Math/Ray.h |