Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
UE::Math::TRay< T > Struct Template Reference

#include <Ray.h>

Public Types

using FReal = T
 

Public Member Functions

 TRay ()
 
 TRay (EForceInit)
 
 TRay (const TVector< T > &Origin, const TVector< T > &Direction, bool bDirectionIsNormalized=false)
 
void Init ()
 
bool operator== (const TRay< T > &Other) const
 
bool operator!= (const TRay< T > &Other) const
 
TVector< TPointAt (T RayParameter) const
 
T GetParameter (const TVector< T > &Point) const
 
T DistSquared (const TVector< T > &Point) const
 
T Dist (const TVector< T > &Point) const
 
TVector< TClosestPoint (const TVector< T > &Point) const
 
FString ToString () const
 
bool Serialize (FArchive &Ar)
 
bool SerializeFromMismatchedTag (FName StructTag, FArchive &Ar)
 
template<typename FArg , TEMPLATE_REQUIRES(!std::is_same_v< T, FArg >) >
 TRay (const TRay< FArg > &From)
 

Public Attributes

TVector< TOrigin
 
TVector< TDirection
 

Friends

FArchiveoperator<< (FArchive &Ar, TRay< T > &Ray)
 

Detailed Description

template<typename T>
struct UE::Math::TRay< T >

Definition at line 17 of file Ray.h.

Member Typedef Documentation

◆ FReal

template<typename T >
using UE::Math::TRay< T >::FReal = T

Definition at line 20 of file Ray.h.

Constructor & Destructor Documentation

◆ TRay() [1/4]

template<typename T >
UE::Math::TRay< T >::TRay ( )
inline

Default constructor initializes ray to Zero origin and Z-axis direction

Definition at line 31 of file Ray.h.

◆ TRay() [2/4]

template<typename T >
UE::Math::TRay< T >::TRay ( EForceInit )
inlineexplicit

Creates and initializes a new Ray to Zero Origin and Z-axis Direction.

Parameters
EForceInitForce Init Enum.

Definition at line 31 of file Ray.h.

◆ TRay() [3/4]

template<typename T >
UE::Math::TRay< T >::TRay ( const TVector< T > & Origin,
const TVector< T > & Direction,
bool bDirectionIsNormalized = false )
inline

Initialize Ray with origin and direction

Parameters
OriginRay Origin Point
DirectionRay Direction Vector
bDirectionIsNormalizedDirection will be normalized unless this is passed as true (default false)

Definition at line 53 of file Ray.h.

◆ TRay() [4/4]

template<typename T >
template<typename FArg , TEMPLATE_REQUIRES(!std::is_same_v< T, FArg >) >
UE::Math::TRay< T >::TRay ( const TRay< FArg > & From)
inlineexplicit

Definition at line 207 of file Ray.h.

Member Function Documentation

◆ ClosestPoint()

template<typename T >
TVector< T > UE::Math::TRay< T >::ClosestPoint ( const TVector< T > & Point) const
inline

Find closest point on ray to query point

Parameters
Pointquery point
Returns
closest point on Ray

Definition at line 156 of file Ray.h.

◆ Dist()

template<typename T >
T UE::Math::TRay< T >::Dist ( const TVector< T > & Point) const
inline

Find minimum distance from query point to ray

Parameters
Pointquery Point
Returns
distance to Ray

Definition at line 146 of file Ray.h.

◆ DistSquared()

template<typename T >
T UE::Math::TRay< T >::DistSquared ( const TVector< T > & Point) const
inline

Find minimum squared distance from query point to ray

Parameters
Pointquery Point
Returns
squared distance to Ray

Definition at line 126 of file Ray.h.

◆ GetParameter()

template<typename T >
T UE::Math::TRay< T >::GetParameter ( const TVector< T > & Point) const
inline

Calculate ray parameter (distance from origin to closest point) for query Point

Parameters
Pointquery Point
Returns
distance along ray from origin to closest point

Definition at line 115 of file Ray.h.

◆ Init()

template<typename T >
void UE::Math::TRay< T >::Init ( )
inline

Set the initial values of the Ray to Zero Origin and Z-axis Direction.

Definition at line 67 of file Ray.h.

◆ operator!=()

template<typename T >
bool UE::Math::TRay< T >::operator!= ( const TRay< T > & Other) const
inline

Compares two Rays for inequality.

Parameters
OtherThe other Ray to compare with.
Returns
true if the Rays are not equal, false otherwise.

Definition at line 90 of file Ray.h.

◆ operator==()

template<typename T >
bool UE::Math::TRay< T >::operator== ( const TRay< T > & Other) const
inline

Compares two Rays for equality.

Parameters
OtherThe other Ray to compare with.
Returns
true if the Rays are equal, false otherwise.

Definition at line 79 of file Ray.h.

◆ PointAt()

template<typename T >
TVector< T > UE::Math::TRay< T >::PointAt ( T RayParameter) const
inline

Calculate position on ray at given distance/parameter

Parameters
RayParameterScalar distance along Ray
Returns
Point on Ray

Definition at line 104 of file Ray.h.

◆ Serialize()

template<typename T >
bool UE::Math::TRay< T >::Serialize ( FArchive & Ar)
inline

Definition at line 197 of file Ray.h.

◆ SerializeFromMismatchedTag()

bool FRay3d::SerializeFromMismatchedTag ( FName StructTag,
FArchive & Ar )
inline

Definition at line 223 of file Ray.h.

◆ ToString()

template<typename T >
FString UE::Math::TRay< T >::ToString ( ) const
inline

Get a textual representation of the Ray.

Returns
Text describing the Ray.

Definition at line 178 of file Ray.h.

Friends And Related Symbol Documentation

◆ operator<<

template<typename T >
FArchive & operator<< ( FArchive & Ar,
TRay< T > & Ray )
friend

Serializes the Ray.

Parameters
ArThe archive to serialize into.
BoxThe box to serialize.
Returns
Reference to the Archive after serialization.

Definition at line 191 of file Ray.h.

Member Data Documentation

◆ Direction

template<typename T >
TVector<T> UE::Math::TRay< T >::Direction

Ray direction vector (always normalized)

Definition at line 26 of file Ray.h.

◆ Origin

template<typename T >
TVector<T> UE::Math::TRay< T >::Origin

Ray origin point

Definition at line 23 of file Ray.h.


The documentation for this struct was generated from the following files: