SA_Maths
Sapphire Suite's C++ Maths Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
SA::TrPosition< T > Struct Template Reference

Transform position component. More...

#include <TransformPosition.hpp>

Public Member Functions

 TrPosition ()=default
 Default constructor.
 
 TrPosition (const Vec3< T > &_pos) noexcept
 Constructor from Vec3.
 
template<typename TOut >
 operator TrPosition< TOut > () const noexcept
 Cast operator.
 

Public Attributes

Vec3< T > position
 Handled position.
 

Protected Member Functions

constexpr bool IsZero () const noexcept
 IsZero component implementation.
 
constexpr bool IsIdentity () const noexcept
 IsIdentity component implementation. position must be at Vec3::Zero for identity transform.
 
constexpr bool Equals (const TrPosition &_other, T _epsilon=std::numeric_limits< T >::epsilon()) const noexcept
 Equals component implementation.
 

Static Protected Member Functions

static TrPosition LerpUnclamped (const TrPosition &_start, const TrPosition &_end, float _alpha) noexcept
 LerpUnclamped component implementation.
 
template<typename LhsT , typename RhsT >
static TrPosition Multiply (const LhsT &_lhs, const RhsT &_rhs) noexcept
 Transform multiplication implementation for position component.
 
template<typename LhsT , typename RhsT >
static TrPosition Divide (const LhsT &_lhs, const RhsT &_rhs) noexcept
 Transform division implementation for position component.
 

Detailed Description

template<typename T>
struct SA::TrPosition< T >

Transform position component.

Template Parameters
TType of the Vector3

Constructor & Destructor Documentation

◆ TrPosition()

template<typename T >
SA::TrPosition< T >::TrPosition ( const Vec3< T > & _pos)
inlinenoexcept

Constructor from Vec3.

Parameters
_posinput position.

Member Function Documentation

◆ Divide()

template<typename T >
template<typename LhsT , typename RhsT >
static TrPosition SA::TrPosition< T >::Divide ( const LhsT & _lhs,
const RhsT & _rhs )
inlinestaticprotectednoexcept

Transform division implementation for position component.

Apply -translation to transform in local-space. If lhs has rotation component, rotate (rhs) translation before application.

Template Parameters
LhsTleft-hand side transform type.
RhsTright-hand side transform type.
Parameters
_lhsleft-hand side transform.
_rhsright-hand side transform.
Returns
output position component from division.

◆ Equals()

template<typename T >
constexpr bool SA::TrPosition< T >::Equals ( const TrPosition< T > & _other,
T _epsilon = std::numeric_limits<T>::epsilon() ) const
inlineconstexprprotectednoexcept

Equals component implementation.

Parameters
_otherother component to compare to.
_epsilonepsilon max used for comparison.
Returns
Whether this and _other are equal.

◆ IsIdentity()

template<typename T >
constexpr bool SA::TrPosition< T >::IsIdentity ( ) const
inlineconstexprprotectednoexcept

IsIdentity component implementation. position must be at Vec3::Zero for identity transform.

Returns
position.IsZero().

◆ IsZero()

template<typename T >
constexpr bool SA::TrPosition< T >::IsZero ( ) const
inlineconstexprprotectednoexcept

IsZero component implementation.

Returns
position.IsZero()

◆ LerpUnclamped()

template<typename T >
static TrPosition SA::TrPosition< T >::LerpUnclamped ( const TrPosition< T > & _start,
const TrPosition< T > & _end,
float _alpha )
inlinestaticprotectednoexcept

LerpUnclamped component implementation.

Parameters
_startStarting point of the lerp.
_endEnding point of the lerp.
_alphaAlpha of the lerp.
Returns
Interpolated position between start and end.

◆ Multiply()

template<typename T >
template<typename LhsT , typename RhsT >
static TrPosition SA::TrPosition< T >::Multiply ( const LhsT & _lhs,
const RhsT & _rhs )
inlinestaticprotectednoexcept

Transform multiplication implementation for position component.

Apply translation to transform in local-space. If lhs has rotation component, rotate (rhs) translation before application.

Template Parameters
LhsTleft-hand side transform type.
RhsTright-hand side transform type.
Parameters
_lhsleft-hand side transform.
_rhsright-hand side transform.
Returns
output position component from multiplication.

◆ operator TrPosition< TOut >()

template<typename T >
template<typename TOut >
SA::TrPosition< T >::operator TrPosition< TOut > ( ) const
inlinenoexcept

Cast operator.

Template Parameters
TOutoutput cast type.
Returns
TrPosition<TOut> Casted component.

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