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

#include <mv/math/Vec2.hpp>

Public Types

using Component = T
 

Public Member Functions

constexpr Vec2 () noexcept=default
 
constexpr Vec2 (T x, T y) noexcept
 
template<typename U >
requires (std::is_arithmetic_v<U> && !std::is_same_v<T, U>)
constexpr Vec2 (const Vec2< U > &other) noexcept
 
constexpr T X () const noexcept
 
constexpr T Y () const noexcept
 
constexpr T operator[] (std::size_t index) const noexcept
 
template<std::size_t Index>
constexpr T Get () const noexcept
 
constexpr void SetX (T value) noexcept
 
constexpr void SetY (T value) noexcept
 
constexpr bool SetComponent (std::size_t index, T value) noexcept
 
template<std::size_t Index>
constexpr void Set (T value) noexcept
 
Vec2 operator+ (const Vec2 &other) const noexcept
 
Vec2 operator- (const Vec2 &other) const noexcept
 
Vec2 operator* (const Vec2 &other) const noexcept
 
Vec2 operator/ (const Vec2 &other) const noexcept
 
Vec2 operator+ (T scalar) const noexcept
 
Vec2 operator- (T scalar) const noexcept
 
Vec2 operator* (T scalar) const noexcept
 
Vec2 operator/ (T scalar) const noexcept
 
Vec2 operator- () const noexcept
 
Vec2 & operator+= (const Vec2 &other) noexcept
 
Vec2 & operator-= (const Vec2 &other) noexcept
 
Vec2 & operator*= (const Vec2 &other) noexcept
 
Vec2 & operator/= (const Vec2 &other) noexcept
 
Vec2 & operator+= (T scalar) noexcept
 
Vec2 & operator-= (T scalar) noexcept
 
Vec2 & operator*= (T scalar) noexcept
 
Vec2 & operator/= (T scalar) noexcept
 

Static Public Member Functions

static constexpr Vec2 Zero () noexcept
 
static constexpr Vec2 One () noexcept
 
static constexpr Vec2 Filled (T value) noexcept
 
static constexpr Vec2 AxisX () noexcept
 
static constexpr Vec2 AxisY () noexcept
 

Detailed Description

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

Definition at line 17 of file Vec2.hpp.

Member Typedef Documentation

◆ Component

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

Definition at line 20 of file Vec2.hpp.

Constructor & Destructor Documentation

◆ Vec2() [1/3]

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

◆ Vec2() [2/3]

template<typename T >
constexpr mv::math::Vec2< T >::Vec2 ( T  x,
T  y 
)
inlineconstexprnoexcept

Definition at line 24 of file Vec2.hpp.

◆ Vec2() [3/3]

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

Definition at line 30 of file Vec2.hpp.

Member Function Documentation

◆ AxisX()

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

Definition at line 50 of file Vec2.hpp.

◆ AxisY()

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

Definition at line 55 of file Vec2.hpp.

◆ Filled()

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

Definition at line 45 of file Vec2.hpp.

◆ Get()

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

Definition at line 77 of file Vec2.hpp.

◆ One()

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

Definition at line 40 of file Vec2.hpp.

◆ operator*() [1/2]

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

Definition at line 123 of file Vec2.hpp.

◆ operator*() [2/2]

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

Definition at line 145 of file Vec2.hpp.

◆ operator*=() [1/2]

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

Definition at line 172 of file Vec2.hpp.

◆ operator*=() [2/2]

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

Definition at line 196 of file Vec2.hpp.

◆ operator+() [1/2]

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

Definition at line 111 of file Vec2.hpp.

◆ operator+() [2/2]

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

Definition at line 135 of file Vec2.hpp.

◆ operator+=() [1/2]

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

Definition at line 160 of file Vec2.hpp.

◆ operator+=() [2/2]

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

Definition at line 184 of file Vec2.hpp.

◆ operator-() [1/3]

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

Definition at line 155 of file Vec2.hpp.

◆ operator-() [2/3]

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

Definition at line 117 of file Vec2.hpp.

◆ operator-() [3/3]

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

Definition at line 140 of file Vec2.hpp.

◆ operator-=() [1/2]

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

Definition at line 166 of file Vec2.hpp.

◆ operator-=() [2/2]

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

Definition at line 190 of file Vec2.hpp.

◆ operator/() [1/2]

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

Definition at line 129 of file Vec2.hpp.

◆ operator/() [2/2]

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

Definition at line 150 of file Vec2.hpp.

◆ operator/=() [1/2]

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

Definition at line 178 of file Vec2.hpp.

◆ operator/=() [2/2]

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

Definition at line 202 of file Vec2.hpp.

◆ operator[]()

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

Definition at line 70 of file Vec2.hpp.

◆ Set()

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

Definition at line 105 of file Vec2.hpp.

◆ SetComponent()

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

Definition at line 93 of file Vec2.hpp.

◆ SetX()

template<typename T >
constexpr void mv::math::Vec2< T >::SetX ( T  value)
inlineconstexprnoexcept

Definition at line 83 of file Vec2.hpp.

◆ SetY()

template<typename T >
constexpr void mv::math::Vec2< T >::SetY ( T  value)
inlineconstexprnoexcept

Definition at line 88 of file Vec2.hpp.

◆ X()

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

Definition at line 60 of file Vec2.hpp.

◆ Y()

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

Definition at line 65 of file Vec2.hpp.

◆ Zero()

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

Definition at line 35 of file Vec2.hpp.


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