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::TrScale< T > Struct Template Reference

Transform scale component. More...

#include <TransformScale.hpp>

Public Member Functions

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

Public Attributes

Vec3< T > scale = Vec3<T>::One
 Handled scale.
 

Protected Member Functions

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

Static Protected Member Functions

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

Detailed Description

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

Transform scale component.

Template Parameters
TType of the Vector3

Constructor & Destructor Documentation

◆ TrScale()

template<typename T >
SA::TrScale< T >::TrScale ( const Vec3< T > & _scale)
inlinenoexcept

Constructor from Vec3.

Parameters
_scaleinput scale.

Member Function Documentation

◆ Divide()

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

Transform division implementation for scale component.

Apply scale from lhs and rhs. If no TrScale component are found in rhs bur UScale component, uses it instead.

Template Parameters
RhsTright-hand side transform type.
Parameters
_lhsleft-hand side transform's scale component.
_rhsright-hand side transform.
Returns
output scale component from division.

◆ Equals()

template<typename T >
constexpr bool SA::TrScale< T >::Equals ( const TrScale< 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::TrScale< T >::IsIdentity ( ) const
inlineconstexprprotectednoexcept

IsIdentity component implementation. scale must be at Vec3::One for identity transform.

Returns
scale == Vec3::One

◆ IsZero()

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

IsZero component implementation.

Returns
scale.IsZero()

◆ LerpUnclamped()

template<typename T >
static TrScale SA::TrScale< T >::LerpUnclamped ( const TrScale< T > & _start,
const TrScale< 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 RhsT >
static TrScale SA::TrScale< T >::Multiply ( const TrScale< T > & _lhs,
const RhsT & _rhs )
inlinestaticprotectednoexcept

Transform multiplication implementation for scale component.

Apply scale from lhs and rhs. If no TrScale component are found in rhs bur UScale component, uses it instead.

Template Parameters
RhsTright-hand side transform type.
Parameters
_lhsleft-hand side transform's scale component.
_rhsright-hand side transform.
Returns
output scale component from multiplication.

◆ operator TrScale< TOut >()

template<typename T >
template<typename TOut >
SA::TrScale< T >::operator TrScale< 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: