Move Vectormath main
C++20 game and graphics mathematics
Loading...
Searching...
No Matches
mv::math::Vec4< T > Class Template Reference

#include <mv/math/Vec4.hpp>

Public Types

using Component = T
 

Public Member Functions

constexpr Vec4 () noexcept=default
 
constexpr Vec4 (T x, T y, T z, T w) noexcept
 
template<typename U >
requires (std::is_arithmetic_v<U> && !std::is_same_v<T, U>)
constexpr Vec4 (const Vec4< U > &other) noexcept
 
template<typename U >
requires std::is_arithmetic_v<U>
constexpr Vec4 (const Vec2< U > &xy, T z=T(0), T w=T(0)) noexcept
 
template<typename U >
requires std::is_arithmetic_v<U>
 Vec4 (const Vec3< U > &xyz, T w=T(0)) noexcept
 
constexpr T X () const noexcept
 
constexpr T Y () const noexcept
 
constexpr T Z () const noexcept
 
constexpr T W () const noexcept
 
constexpr T operator[] (std::size_t index) const noexcept
 
template<std::size_t Index>
constexpr T Get () const noexcept
 
constexpr bool SetComponent (std::size_t index, T value) noexcept
 
template<std::size_t Index>
constexpr void Set (T value) noexcept
 
constexpr Vec2< T > XY () const noexcept
 
constexpr Vec2< T > ZW () const noexcept
 
Vec3< T > XYZ () const noexcept
 
Vec4 operator+ (const Vec4 &other) const noexcept
 
Vec4 operator- (const Vec4 &other) const noexcept
 
Vec4 operator* (const Vec4 &other) const noexcept
 
Vec4 operator/ (const Vec4 &other) const noexcept
 
Vec4 operator+ (T scalar) const noexcept
 
Vec4 operator- (T scalar) const noexcept
 
Vec4 operator* (T scalar) const noexcept
 
Vec4 operator/ (T scalar) const noexcept
 
Vec4 operator- () const noexcept
 
Vec4 & operator+= (const Vec4 &other) noexcept
 
Vec4 & operator-= (const Vec4 &other) noexcept
 
Vec4 & operator*= (const Vec4 &other) noexcept
 
Vec4 & operator/= (const Vec4 &other) noexcept
 
Vec4 & operator+= (T scalar) noexcept
 
Vec4 & operator-= (T scalar) noexcept
 
Vec4 & operator*= (T scalar) noexcept
 
Vec4 & operator/= (T scalar) noexcept
 

Static Public Member Functions

static constexpr Vec4 Zero () noexcept
 
static constexpr Vec4 One () noexcept
 
static constexpr Vec4 Filled (T value) noexcept
 
static constexpr Vec4 AxisX () noexcept
 
static constexpr Vec4 AxisY () noexcept
 
static constexpr Vec4 AxisZ () noexcept
 
static constexpr Vec4 AxisW () noexcept
 

Detailed Description

template<typename T>
requires std::is_arithmetic_v<T>
class mv::math::Vec4< T >

Definition at line 22 of file Vec4.hpp.

Member Typedef Documentation

◆ Component

template<typename T >
using mv::math::Vec4< T >::Component = T

Definition at line 25 of file Vec4.hpp.

Constructor & Destructor Documentation

◆ Vec4() [1/5]

template<typename T >
constexpr mv::math::Vec4< T >::Vec4 ( )
constexprdefaultnoexcept

◆ Vec4() [2/5]

template<typename T >
constexpr mv::math::Vec4< T >::Vec4 ( T  x,
T  y,
T  z,
T  w 
)
inlineconstexprnoexcept

Definition at line 29 of file Vec4.hpp.

◆ Vec4() [3/5]

template<typename T >
template<typename U >
requires (std::is_arithmetic_v<U> && !std::is_same_v<T, U>)
constexpr mv::math::Vec4< T >::Vec4 ( const Vec4< U > &  other)
inlineexplicitconstexprnoexcept

Definition at line 35 of file Vec4.hpp.

◆ Vec4() [4/5]

template<typename T >
template<typename U >
requires std::is_arithmetic_v<U>
constexpr mv::math::Vec4< T >::Vec4 ( const Vec2< U > &  xy,
T  z = T(0),
T  w = T(0) 
)
inlineexplicitconstexprnoexcept

Definition at line 43 of file Vec4.hpp.

◆ Vec4() [5/5]

template<typename T >
template<typename U >
requires std::is_arithmetic_v<U>
mv::math::Vec4< T >::Vec4 ( const Vec3< U > &  xyz,
T  w = T(0) 
)
inlineexplicitnoexcept

Definition at line 52 of file Vec4.hpp.

Member Function Documentation

◆ AxisW()

template<typename T >
static constexpr Vec4 mv::math::Vec4< T >::AxisW ( )
inlinestaticconstexprnoexcept

Definition at line 88 of file Vec4.hpp.

◆ AxisX()

template<typename T >
static constexpr Vec4 mv::math::Vec4< T >::AxisX ( )
inlinestaticconstexprnoexcept

Definition at line 73 of file Vec4.hpp.

◆ AxisY()

template<typename T >
static constexpr Vec4 mv::math::Vec4< T >::AxisY ( )
inlinestaticconstexprnoexcept

Definition at line 78 of file Vec4.hpp.

◆ AxisZ()

template<typename T >
static constexpr Vec4 mv::math::Vec4< T >::AxisZ ( )
inlinestaticconstexprnoexcept

Definition at line 83 of file Vec4.hpp.

◆ Filled()

template<typename T >
static constexpr Vec4 mv::math::Vec4< T >::Filled ( T  value)
inlinestaticconstexprnoexcept

Definition at line 68 of file Vec4.hpp.

◆ Get()

template<typename T >
template<std::size_t Index>
constexpr T mv::math::Vec4< T >::Get ( ) const
inlineconstexprnoexcept

Definition at line 117 of file Vec4.hpp.

◆ One()

template<typename T >
static constexpr Vec4 mv::math::Vec4< T >::One ( )
inlinestaticconstexprnoexcept

Definition at line 63 of file Vec4.hpp.

◆ operator*() [1/2]

template<typename T >
Vec4 mv::math::Vec4< T >::operator* ( const Vec4< T > &  other) const
inlinenoexcept

Definition at line 168 of file Vec4.hpp.

◆ operator*() [2/2]

template<typename T >
Vec4 mv::math::Vec4< T >::operator* ( T  scalar) const
inlinenoexcept

Definition at line 190 of file Vec4.hpp.

◆ operator*=() [1/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator*= ( const Vec4< T > &  other)
inlinenoexcept

Definition at line 217 of file Vec4.hpp.

◆ operator*=() [2/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator*= ( T  scalar)
inlinenoexcept

Definition at line 241 of file Vec4.hpp.

◆ operator+() [1/2]

template<typename T >
Vec4 mv::math::Vec4< T >::operator+ ( const Vec4< T > &  other) const
inlinenoexcept

Definition at line 156 of file Vec4.hpp.

◆ operator+() [2/2]

template<typename T >
Vec4 mv::math::Vec4< T >::operator+ ( T  scalar) const
inlinenoexcept

Definition at line 180 of file Vec4.hpp.

◆ operator+=() [1/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator+= ( const Vec4< T > &  other)
inlinenoexcept

Definition at line 205 of file Vec4.hpp.

◆ operator+=() [2/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator+= ( T  scalar)
inlinenoexcept

Definition at line 229 of file Vec4.hpp.

◆ operator-() [1/3]

template<typename T >
Vec4 mv::math::Vec4< T >::operator- ( ) const
inlinenoexcept

Definition at line 200 of file Vec4.hpp.

◆ operator-() [2/3]

template<typename T >
Vec4 mv::math::Vec4< T >::operator- ( const Vec4< T > &  other) const
inlinenoexcept

Definition at line 162 of file Vec4.hpp.

◆ operator-() [3/3]

template<typename T >
Vec4 mv::math::Vec4< T >::operator- ( T  scalar) const
inlinenoexcept

Definition at line 185 of file Vec4.hpp.

◆ operator-=() [1/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator-= ( const Vec4< T > &  other)
inlinenoexcept

Definition at line 211 of file Vec4.hpp.

◆ operator-=() [2/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator-= ( T  scalar)
inlinenoexcept

Definition at line 235 of file Vec4.hpp.

◆ operator/() [1/2]

template<typename T >
Vec4 mv::math::Vec4< T >::operator/ ( const Vec4< T > &  other) const
inlinenoexcept

Definition at line 174 of file Vec4.hpp.

◆ operator/() [2/2]

template<typename T >
Vec4 mv::math::Vec4< T >::operator/ ( T  scalar) const
inlinenoexcept

Definition at line 195 of file Vec4.hpp.

◆ operator/=() [1/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator/= ( const Vec4< T > &  other)
inlinenoexcept

Definition at line 223 of file Vec4.hpp.

◆ operator/=() [2/2]

template<typename T >
Vec4 & mv::math::Vec4< T >::operator/= ( T  scalar)
inlinenoexcept

Definition at line 247 of file Vec4.hpp.

◆ operator[]()

template<typename T >
constexpr T mv::math::Vec4< T >::operator[] ( std::size_t  index) const
inlineconstexprnoexcept

Definition at line 110 of file Vec4.hpp.

◆ Set()

template<typename T >
template<std::size_t Index>
constexpr void mv::math::Vec4< T >::Set ( T  value)
inlineconstexprnoexcept

Definition at line 135 of file Vec4.hpp.

◆ SetComponent()

template<typename T >
constexpr bool mv::math::Vec4< T >::SetComponent ( std::size_t  index,
T  value 
)
inlineconstexprnoexcept

Definition at line 123 of file Vec4.hpp.

◆ W()

template<typename T >
constexpr T mv::math::Vec4< T >::W ( ) const
inlineconstexprnoexcept

Definition at line 105 of file Vec4.hpp.

◆ X()

template<typename T >
constexpr T mv::math::Vec4< T >::X ( ) const
inlineconstexprnoexcept

Definition at line 93 of file Vec4.hpp.

◆ XY()

template<typename T >
constexpr Vec2< T > mv::math::Vec4< T >::XY ( ) const
inlineconstexprnoexcept

Definition at line 141 of file Vec4.hpp.

◆ XYZ()

template<typename T >
Vec3< T > mv::math::Vec4< T >::XYZ ( ) const
inlinenoexcept

Definition at line 151 of file Vec4.hpp.

◆ Y()

template<typename T >
constexpr T mv::math::Vec4< T >::Y ( ) const
inlineconstexprnoexcept

Definition at line 97 of file Vec4.hpp.

◆ Z()

template<typename T >
constexpr T mv::math::Vec4< T >::Z ( ) const
inlineconstexprnoexcept

Definition at line 101 of file Vec4.hpp.

◆ Zero()

template<typename T >
static constexpr Vec4 mv::math::Vec4< T >::Zero ( )
inlinestaticconstexprnoexcept

Definition at line 58 of file Vec4.hpp.

◆ ZW()

template<typename T >
constexpr Vec2< T > mv::math::Vec4< T >::ZW ( ) const
inlineconstexprnoexcept

Definition at line 146 of file Vec4.hpp.


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