Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TransformCalculus.h File Reference
#include "CoreTypes.h"
#include "Math/Vector2D.h"
#include "Math/Vector.h"
+ Include dependency graph for TransformCalculus.h:
+ This graph shows which files directly or indirectly include this file:

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 >
auto TransformCast (const TransformType &Transform) -> decltype(TransformConverter< ResultType >::Convert(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 TransformType3 >
auto Concatenate (const TransformType1 &TransformAToB, const TransformType2 &TransformBToC, const TransformType3 &TransformCToD) -> decltype(Concatenate(Concatenate(TransformAToB, TransformBToC), TransformCToD))
 
template<typename TransformType1 , typename TransformType2 , typename TransformType3 , typename TransformType4 >
auto Concatenate (const TransformType1 &TransformAToB, const TransformType2 &TransformBToC, const TransformType3 &TransformCToD, const TransformType4 &TransformDToE) -> decltype(Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD), TransformDToE))
 
template<typename TransformType1 , typename TransformType2 , typename TransformType3 , typename TransformType4 , typename TransformType5 >
auto Concatenate (const TransformType1 &TransformAToB, const TransformType2 &TransformBToC, const TransformType3 &TransformCToD, const TransformType4 &TransformDToE, const TransformType5 &TransformEToF) -> decltype(Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD, TransformDToE), TransformEToF))
 
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 , TEMPLATE_REQUIRES(TIsFloatingPoint< FloatType >::Value) >
FloatType Concatenate (FloatType LHS, FloatType RHS)
 
template<typename FloatType , TEMPLATE_REQUIRES(TIsFloatingPoint< FloatType >::Value) >
FloatType Inverse (FloatType Scale)
 
template<typename PositionType >
UE::Math::TVector< PositionTypeTransformPoint (float Transform, const UE::Math::TVector< PositionType > &Point)
 
template<typename PositionType >
UE::Math::TVector< PositionTypeTransformPoint (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/7]

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.

Definition at line 305 of file TransformCalculus.h.

◆ Concatenate() [2/7]

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.

Definition at line 319 of file TransformCalculus.h.

◆ Concatenate() [3/7]

auto Concatenate ( const TransformType1 & TransformAToB,
const TransformType2 & TransformBToC,
const TransformType3 & TransformCToD ) -> decltype(Concatenate(Concatenate(TransformAToB, TransformBToC), TransformCToD))
inline

Concatenates three 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.
TransformCToDTransformation that goes from space C to space D.
Returns
a new Transform representing the transformation from space A to space D.

Definition at line 336 of file TransformCalculus.h.

◆ Concatenate() [4/7]

auto Concatenate ( const TransformType1 & TransformAToB,
const TransformType2 & TransformBToC,
const TransformType3 & TransformCToD,
const TransformType4 & TransformDToE ) -> decltype(Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD), TransformDToE))
inline

Concatenates four 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.
TransformCToDTransformation that goes from space C to space D.
TransformDToETransformation that goes from space D to space E.
Returns
a new Transform representing the transformation from space A to space E.

Definition at line 352 of file TransformCalculus.h.

◆ Concatenate() [5/7]

auto Concatenate ( const TransformType1 & TransformAToB,
const TransformType2 & TransformBToC,
const TransformType3 & TransformCToD,
const TransformType4 & TransformDToE,
const TransformType5 & TransformEToF ) -> decltype(Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD, TransformDToE), TransformEToF))
inline

Concatenates five 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.
TransformCToDTransformation that goes from space C to space D.
TransformDToETransformation that goes from space D to space E.
TransformEToFTransformation that goes from space E to space F.
Returns
a new Transform representing the transformation from space A to space F.

Definition at line 369 of file TransformCalculus.h.

◆ Concatenate() [6/7]

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.

Definition at line 293 of file TransformCalculus.h.

◆ Concatenate() [7/7]

template<typename FloatType , TEMPLATE_REQUIRES(TIsFloatingPoint< FloatType >::Value) >
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.

Definition at line 421 of file TransformCalculus.h.

◆ 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.

Definition at line 382 of file TransformCalculus.h.

◆ Inverse() [2/2]

template<typename FloatType , TEMPLATE_REQUIRES(TIsFloatingPoint< FloatType >::Value) >
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.

Definition at line 434 of file TransformCalculus.h.

◆ TransformCast()

template<typename ResultType , typename TransformType >
auto TransformCast ( const TransformType & Transform) -> decltype(TransformConverter<ResultType>::Convert(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.

Definition at line 262 of file TransformCalculus.h.

◆ TransformPoint() [1/3]

PositionType TransformPoint ( const TransformType & Transform,
const PositionType & Point )
inline

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

Definition at line 391 of file TransformCalculus.h.

◆ TransformPoint() [2/3]

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

Definition at line 449 of file TransformCalculus.h.

◆ TransformPoint() [3/3]

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

Specialization for uniform Scale.

Definition at line 443 of file TransformCalculus.h.

◆ 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.

Definition at line 400 of file TransformCalculus.h.

◆ TransformVector() [2/3]

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

Definition at line 464 of file TransformCalculus.h.

◆ TransformVector() [3/3]

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

Specialization for uniform Scale.

Definition at line 458 of file TransformCalculus.h.