UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TransformCalculus.h File Reference
#include "CoreTypes.h"
#include "Math/Vector2D.h"
#include "Math/Vector.h"

Go to the source code of this file.

Classes

struct  TransformConverter< TransformType >
 
struct  ConcatenateRules< TransformTypeA, TransformTypeB >
 
struct  ConcatenateRules< TransformType, TransformType >
 

Functions

template<typename ResultType , typename TransformType >
decltype(autoTransformCast (const TransformType &Transform)
 
template<typename TransformTypeA , typename TransformTypeB >
ConcatenateRules< TransformTypeA, TransformTypeB >::ResultType Concatenate (const TransformTypeA &LHS, const TransformTypeB &RHS)
 
template<typename ReturnType , typename LHSType , typename RHSType >
ReturnType Concatenate (const LHSType &LHS, const RHSType &RHS)
 
template<typename TransformType >
auto Concatenate (const TransformType &LHS, const TransformType &RHS) -> decltype(LHS.Concatenate(RHS))
 
template<typename TransformType1 , typename TransformType2 , typename... TransformTypeRest>
decltype(autoConcatenate (const TransformType1 &TransformAToB, const TransformType2 &TransformBToC, TransformTypeRest &&... TransformCToRest)
 
template<typename TransformType >
auto Inverse (const TransformType &Transform) -> decltype(Transform.Inverse())
 
template<typename TransformType , typename PositionType >
PositionType TransformPoint (const TransformType &Transform, const PositionType &Point)
 
template<typename TransformType , typename VectorType >
VectorType TransformVector (const TransformType &Transform, const VectorType &Vector)
 
template<typename FloatType UE_REQUIRES>
FloatType Concatenate (FloatType LHS, FloatType RHS)
 
template<typename FloatType UE_REQUIRES>
FloatType Inverse (FloatType Scale)
 
template<typename PositionType >
UE::Math::TVector< PositionType > TransformPoint (float Transform, const UE::Math::TVector< PositionType > &Point)
 
template<typename PositionType >
UE::Math::TVector< PositionType > TransformPoint (double Transform, const UE::Math::TVector< PositionType > &Point)
 
template<typename VectorType >
UE::Math::TVector< VectorType > TransformVector (float Transform, const UE::Math::TVector< VectorType > &Vector)
 
template<typename VectorType >
UE::Math::TVector< VectorType > TransformVector (double Transform, const UE::Math::TVector< VectorType > &Vector)
 

Function Documentation

◆ Concatenate() [1/5]

template<typename ReturnType , typename LHSType , typename RHSType >
ReturnType Concatenate ( const LHSType LHS,
const RHSType RHS 
)
inline

Special overload that allows one to explicitly define the result type, which applies TransformCast on each argument first.

◆ Concatenate() [2/5]

template<typename TransformType >
auto Concatenate ( const TransformType &  LHS,
const TransformType &  RHS 
) -> decltype(LHS.Concatenate(RHS))
inline

Specialization for concatenating two transforms of the same type. By default we try to use a member function on the type.

Parameters
LHSTransformation that goes from space A to space B
RHSTransformation that goes from space B to space C.
Returns
a new transform representing the transformation from the input space of LHS to the output space of RHS.

◆ Concatenate() [3/5]

template<typename TransformType1 , typename TransformType2 , typename... TransformTypeRest>
decltype(auto) Concatenate ( const TransformType1 TransformAToB,
const TransformType2 TransformBToC,
TransformTypeRest &&...  TransformCToRest 
)
inline

Concatenates three or more transforms. Uses two-argument Concatenate to do its work, and infers the return type using decltype.

Parameters
TransformAToBTransformation that goes from space A to space B
TransformBToCTransformation that goes from space B to space C.
TransformCToRestTransformation that goes from space C onwards.
Returns
a new Transform representing the complete transformation.

◆ Concatenate() [4/5]

ConcatenateRules< TransformTypeA, TransformTypeB >::ResultType Concatenate ( const TransformTypeA LHS,
const TransformTypeB RHS 
)
inline

Concatenates two transforms. Uses TransformCast<> to convert them first. If more efficient means are available to concatenate two transforms, provide a non-template overload (or possibly a specialization). Concatenation is performed in left to right order, so the output space of LHS must match the input space of RHS.

Parameters
LHSTransformation that goes from space A to space B
RHSTransformation that goes from space B to space C.
Returns
a new transform representing the transformation from the input space of LHS to the output space of RHS.

◆ Concatenate() [5/5]

template<typename FloatType UE_REQUIRES>
FloatType Concatenate ( FloatType  LHS,
FloatType  RHS 
)
inline

Specialization for concatenating two scales.

Parameters
LHSScale that goes from space A to space B
RHSScale that goes from space B to space C.
Returns
a new Scale representing the transformation from the input space of LHS to the output space of RHS.

◆ Inverse() [1/2]

template<typename TransformType >
auto Inverse ( const TransformType &  Transform) -> decltype(Transform.Inverse())
inline

Inverts a transform from space A to space B so it transforms from space B to space A. By default attempts to call a member function on the transform type.

Parameters
TransformInput transform from space A to space B.
Returns
Inverted transform from space B to space A.

◆ Inverse() [2/2]

template<typename FloatType UE_REQUIRES>
FloatType Inverse ( FloatType  Scale)
inline

Inverts a transform from space A to space B so it transforms from space B to space A. Specialization for uniform scale.

Parameters
TransformInput transform from space A to space B.
Returns
Inverted transform from space B to space A.

◆ TransformCast()

template<typename ResultType , typename TransformType >
decltype(auto) TransformCast ( const TransformType &  Transform)
inline

Casts one TransformType to ResultType using rules laid out by TransformConverter<>::Convert<>().

Return type uses decltype to support classes that can return by const-ref more efficiently than returning a new value.

◆ TransformPoint() [1/3]

template<typename TransformType , typename PositionType >
PositionType TransformPoint ( const TransformType &  Transform,
const PositionType &  Point 
)
inline

Generic implementation of TransformPoint. Attempts to use a member function of the TransformType.

◆ TransformPoint() [2/3]

template<typename PositionType >
UE::Math::TVector< PositionType > TransformPoint ( double  Transform,
const UE::Math::TVector< PositionType > &  Point 
)
inline

◆ TransformPoint() [3/3]

template<typename PositionType >
UE::Math::TVector< PositionType > TransformPoint ( float  Transform,
const UE::Math::TVector< PositionType > &  Point 
)
inline

Specialization for uniform Scale.

◆ TransformVector() [1/3]

template<typename TransformType , typename VectorType >
VectorType TransformVector ( const TransformType &  Transform,
const VectorType &  Vector 
)
inline

Generic implementation of TransformVector. Attempts to use a member function of the TransformType.

◆ TransformVector() [2/3]

template<typename VectorType >
UE::Math::TVector< VectorType > TransformVector ( double  Transform,
const UE::Math::TVector< VectorType > &  Vector 
)
inline

◆ TransformVector() [3/3]

template<typename VectorType >
UE::Math::TVector< VectorType > TransformVector ( float  Transform,
const UE::Math::TVector< VectorType > &  Vector 
)
inline

Specialization for uniform Scale.