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

#include <mv/math/Vec3.hpp>

Public Types

using Component = T
 

Public Member Functions

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

Static Public Member Functions

static Vec3 Zero () noexcept
 
static Vec3 One () noexcept
 
static Vec3 Filled (T value) noexcept
 
static Vec3 AxisX () noexcept
 
static Vec3 AxisY () noexcept
 
static Vec3 AxisZ () noexcept
 

Detailed Description

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

Definition at line 44 of file Vec3.hpp.

Member Typedef Documentation

◆ Component

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

Definition at line 50 of file Vec3.hpp.

Constructor & Destructor Documentation

◆ Vec3() [1/4]

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

Definition at line 52 of file Vec3.hpp.

◆ Vec3() [2/4]

template<typename T >
mv::math::Vec3< T >::Vec3 ( T  x,
T  y,
T  z 
)
inlinenoexcept

Definition at line 56 of file Vec3.hpp.

◆ Vec3() [3/4]

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

Definition at line 64 of file Vec3.hpp.

◆ Vec3() [4/4]

template<typename T >
template<typename U >
requires std::is_arithmetic_v<U>
mv::math::Vec3< T >::Vec3 ( const Vec2< U > &  xy,
T  z = T(0) 
)
inlineexplicitnoexcept

Definition at line 73 of file Vec3.hpp.

Member Function Documentation

◆ AxisX()

template<typename T >
static Vec3 mv::math::Vec3< T >::AxisX ( )
inlinestaticnoexcept

Definition at line 93 of file Vec3.hpp.

◆ AxisY()

template<typename T >
static Vec3 mv::math::Vec3< T >::AxisY ( )
inlinestaticnoexcept

Definition at line 98 of file Vec3.hpp.

◆ AxisZ()

template<typename T >
static Vec3 mv::math::Vec3< T >::AxisZ ( )
inlinestaticnoexcept

Definition at line 103 of file Vec3.hpp.

◆ Filled()

template<typename T >
static Vec3 mv::math::Vec3< T >::Filled ( T  value)
inlinestaticnoexcept

Definition at line 88 of file Vec3.hpp.

◆ Get()

template<typename T >
template<std::size_t Index>
T mv::math::Vec3< T >::Get ( ) const
inlinenoexcept

Definition at line 138 of file Vec3.hpp.

◆ One()

template<typename T >
static Vec3 mv::math::Vec3< T >::One ( )
inlinestaticnoexcept

Definition at line 83 of file Vec3.hpp.

◆ operator*() [1/2]

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

Definition at line 231 of file Vec3.hpp.

◆ operator*() [2/2]

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

Definition at line 236 of file Vec3.hpp.

◆ operator*=() [1/2]

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

Definition at line 278 of file Vec3.hpp.

◆ operator*=() [2/2]

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

Definition at line 302 of file Vec3.hpp.

◆ operator+() [1/2]

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

Definition at line 221 of file Vec3.hpp.

◆ operator+() [2/2]

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

Definition at line 246 of file Vec3.hpp.

◆ operator+=() [1/2]

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

Definition at line 266 of file Vec3.hpp.

◆ operator+=() [2/2]

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

Definition at line 290 of file Vec3.hpp.

◆ operator-() [1/3]

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

Definition at line 261 of file Vec3.hpp.

◆ operator-() [2/3]

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

Definition at line 226 of file Vec3.hpp.

◆ operator-() [3/3]

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

Definition at line 251 of file Vec3.hpp.

◆ operator-=() [1/2]

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

Definition at line 272 of file Vec3.hpp.

◆ operator-=() [2/2]

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

Definition at line 296 of file Vec3.hpp.

◆ operator/() [1/2]

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

Definition at line 241 of file Vec3.hpp.

◆ operator/() [2/2]

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

Definition at line 256 of file Vec3.hpp.

◆ operator/=() [1/2]

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

Definition at line 284 of file Vec3.hpp.

◆ operator/=() [2/2]

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

Definition at line 308 of file Vec3.hpp.

◆ operator[]()

template<typename T >
T mv::math::Vec3< T >::operator[] ( std::size_t  index) const
inlinenoexcept

Definition at line 123 of file Vec3.hpp.

◆ Set()

template<typename T >
template<std::size_t Index>
void mv::math::Vec3< T >::Set ( T  value)
inlinenoexcept

Definition at line 204 of file Vec3.hpp.

◆ SetComponent()

template<typename T >
bool mv::math::Vec3< T >::SetComponent ( std::size_t  index,
T  value 
)
inlinenoexcept

Definition at line 185 of file Vec3.hpp.

◆ SetX()

template<typename T >
void mv::math::Vec3< T >::SetX ( T  value)
inlinenoexcept

Definition at line 170 of file Vec3.hpp.

◆ SetY()

template<typename T >
void mv::math::Vec3< T >::SetY ( T  value)
inlinenoexcept

Definition at line 175 of file Vec3.hpp.

◆ SetZ()

template<typename T >
void mv::math::Vec3< T >::SetZ ( T  value)
inlinenoexcept

Definition at line 180 of file Vec3.hpp.

◆ X()

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

Definition at line 108 of file Vec3.hpp.

◆ XY()

template<typename T >
Vec2< T > mv::math::Vec3< T >::XY ( ) const
inlinenoexcept

Definition at line 155 of file Vec3.hpp.

◆ XZ()

template<typename T >
Vec2< T > mv::math::Vec3< T >::XZ ( ) const
inlinenoexcept

Definition at line 160 of file Vec3.hpp.

◆ Y()

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

Definition at line 113 of file Vec3.hpp.

◆ YZ()

template<typename T >
Vec2< T > mv::math::Vec3< T >::YZ ( ) const
inlinenoexcept

Definition at line 165 of file Vec3.hpp.

◆ Z()

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

Definition at line 118 of file Vec3.hpp.

◆ Zero()

template<typename T >
static Vec3 mv::math::Vec3< T >::Zero ( )
inlinestaticnoexcept

Definition at line 78 of file Vec3.hpp.


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