LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Math::Vector< T, DIM > Class Template Reference

#include <vector.hpp>

Public Types

using scalar_type = T
 
using vec_type = Vector< scalar_type, vec_size >
 

Public Member Functions

 Vector () noexcept=default
 
 Vector (const T &val) noexcept
 
 Vector (const vec_type &_other) noexcept
 
 Vector (vec_type &&_other) noexcept
 
Vector< T, DIM > & operator= (const Vector< T, DIM > &_other) noexcept
 
Vector< T, DIM > & operator= (Vector< T, DIM > &&_other) noexcept
 
const T & operator[] (const unsigned int &i) const noexcept
 
T & operator[] (const unsigned int &i) noexcept
 
const scalar_typeelements () const noexcept
 
int size () const noexcept
 
template<typename = std::enable_if_t<(DIM > 0)>>
const scalar_typex () const noexcept
 
template<typename = std::enable_if_t<(DIM > 0)>>
scalar_typex () noexcept
 
template<typename = std::enable_if_t<(DIM > 1)>>
const scalar_typey () const noexcept
 
template<typename = std::enable_if_t<(DIM > 1)>>
scalar_typey () noexcept
 
template<typename = std::enable_if_t<(DIM > 2)>>
const scalar_typez () const noexcept
 
template<typename = std::enable_if_t<(DIM > 2)>>
scalar_typez () noexcept
 
template<typename = std::enable_if_t<(DIM > 3)>>
const scalar_typew () const noexcept
 
template<typename = std::enable_if_t<(DIM > 3)>>
scalar_typew () noexcept
 

Static Public Attributes

static constexpr size_t vec_size = DIM
 

Protected Attributes

scalar_type m_elements [vec_size] = { }
 

Member Typedef Documentation

◆ scalar_type

template<typename T , unsigned DIM>
using LiteFX::Math::Vector< T, DIM >::scalar_type = T

◆ vec_type

template<typename T , unsigned DIM>
using LiteFX::Math::Vector< T, DIM >::vec_type = Vector<scalar_type, vec_size>

Constructor & Destructor Documentation

◆ Vector() [1/4]

template<typename T , unsigned DIM>
LiteFX::Math::Vector< T, DIM >::Vector ( )
defaultnoexcept

◆ Vector() [2/4]

template<typename T , unsigned DIM>
LiteFX::Math::Vector< T, DIM >::Vector ( const T &  val)
inlinenoexcept

◆ Vector() [3/4]

template<typename T , unsigned DIM>
LiteFX::Math::Vector< T, DIM >::Vector ( const vec_type _other)
inlinenoexcept

◆ Vector() [4/4]

template<typename T , unsigned DIM>
LiteFX::Math::Vector< T, DIM >::Vector ( vec_type &&  _other)
inlinenoexcept

Member Function Documentation

◆ elements()

template<typename T , unsigned DIM>
const scalar_type * LiteFX::Math::Vector< T, DIM >::elements ( ) const
inlinenoexcept

◆ operator=() [1/2]

template<typename T , unsigned DIM>
Vector< T, DIM > & LiteFX::Math::Vector< T, DIM >::operator= ( const Vector< T, DIM > &  _other)
inlinenoexcept

◆ operator=() [2/2]

template<typename T , unsigned DIM>
Vector< T, DIM > & LiteFX::Math::Vector< T, DIM >::operator= ( Vector< T, DIM > &&  _other)
inlinenoexcept

◆ operator[]() [1/2]

template<typename T , unsigned DIM>
const T & LiteFX::Math::Vector< T, DIM >::operator[] ( const unsigned int &  i) const
inlinenoexcept

◆ operator[]() [2/2]

template<typename T , unsigned DIM>
T & LiteFX::Math::Vector< T, DIM >::operator[] ( const unsigned int &  i)
inlinenoexcept

◆ size()

template<typename T , unsigned DIM>
int LiteFX::Math::Vector< T, DIM >::size ( ) const
inlinenoexcept

◆ w() [1/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 3)>>
const scalar_type & LiteFX::Math::Vector< T, DIM >::w ( ) const
inlinenoexcept

◆ w() [2/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 3)>>
scalar_type & LiteFX::Math::Vector< T, DIM >::w ( )
inlinenoexcept

◆ x() [1/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 0)>>
const scalar_type & LiteFX::Math::Vector< T, DIM >::x ( ) const
inlinenoexcept

◆ x() [2/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 0)>>
scalar_type & LiteFX::Math::Vector< T, DIM >::x ( )
inlinenoexcept

◆ y() [1/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 1)>>
const scalar_type & LiteFX::Math::Vector< T, DIM >::y ( ) const
inlinenoexcept

◆ y() [2/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 1)>>
scalar_type & LiteFX::Math::Vector< T, DIM >::y ( )
inlinenoexcept

◆ z() [1/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 2)>>
const scalar_type & LiteFX::Math::Vector< T, DIM >::z ( ) const
inlinenoexcept

◆ z() [2/2]

template<typename T , unsigned DIM>
template<typename = std::enable_if_t<(DIM > 2)>>
scalar_type & LiteFX::Math::Vector< T, DIM >::z ( )
inlinenoexcept

Member Data Documentation

◆ m_elements

template<typename T , unsigned DIM>
scalar_type LiteFX::Math::Vector< T, DIM >::m_elements[vec_size] = { }
protected

◆ vec_size

template<typename T , unsigned DIM>
constexpr size_t LiteFX::Math::Vector< T, DIM >::vec_size = DIM
staticconstexpr