MeshLib
 
Loading...
Searching...
No Matches
MR::Vector4< T > Struct Template Reference

#include <MRVector4.h>

Public Types

using ValueType = T
 
using MatrixType = Matrix4<T>
 
using SymMatrixType = SymMatrix4<T>
 

Public Member Functions

constexpr Vector4 () noexcept
 
 Vector4 (NoInit) noexcept
 
constexpr Vector4 (T x, T y, T z, T w) noexcept
 
template<typename U >
constexpr Vector4 (const Vector4< U > &v) noexcept
 
constexpr const T & operator[] (int e) const noexcept
 
constexpr T & operator[] (int e) noexcept
 
lengthSq () const
 
auto length () const
 
Vector4 normalized () const MR_REQUIRES_IF_SUPPORTED(!std
 
Vector4 operator- () const
 
const Vector4operator+ () const
 
Vector4operator+= (const Vector4< T > &b)
 
Vector4operator-= (const Vector4< T > &b)
 
Vector4operator*= (T b)
 
Vector4operator/= (T b)
 
Vector3< T > proj3d () const MR_REQUIRES_IF_SUPPORTED(!std
 assuming this is a point represented in homogeneous 4D coordinates, returns the point as 3D-vector
 
bool isFinite () const MR_REQUIRES_IF_SUPPORTED(std
 

Static Public Member Functions

static constexpr Vector4 diagonal (T a) noexcept
 

Public Attributes

x
 
y
 
z
 
w
 

Static Public Attributes

static constexpr int elements = 4
 

Related Symbols

(Note that these are not member symbols.)

template<typename T >
bool operator== (const Vector4< T > &a, const Vector4< T > &b)
 
template<typename T >
dot (const Vector4< T > &a, const Vector4< T > &b)
 dot product
 
template<typename T >
sqr (const Vector4< T > &a)
 squared length
 
template<typename T >
Vector4< T > mult (const Vector4< T > &a, const Vector4< T > &b)
 per component multiplication
 
template<typename T >
Vector4< T > div (const Vector4< T > &a, const Vector4< T > &b)
 per component division
 

Detailed Description

template<typename T>
struct MR::Vector4< T >

four-dimensional vector

Member Typedef Documentation

◆ MatrixType

template<typename T >
using MR::Vector4< T >::MatrixType = Matrix4<T>

◆ SymMatrixType

template<typename T >
using MR::Vector4< T >::SymMatrixType = SymMatrix4<T>

◆ ValueType

template<typename T >
using MR::Vector4< T >::ValueType = T

Constructor & Destructor Documentation

◆ Vector4() [1/4]

template<typename T >
MR::Vector4< T >::Vector4 ( )
inlineconstexprnoexcept

◆ Vector4() [2/4]

template<typename T >
MR::Vector4< T >::Vector4 ( NoInit )
inlineexplicitnoexcept

◆ Vector4() [3/4]

template<typename T >
MR::Vector4< T >::Vector4 ( T x,
T y,
T z,
T w )
inlineconstexprnoexcept

◆ Vector4() [4/4]

template<typename T >
template<typename U >
MR::Vector4< T >::Vector4 ( const Vector4< U > & v)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ diagonal()

template<typename T >
static constexpr Vector4 MR::Vector4< T >::diagonal ( T a)
inlinestaticconstexprnoexcept

◆ isFinite()

template<typename T >
bool MR::Vector4< T >::isFinite ( ) const
inlinenodiscard

◆ length()

template<typename T >
auto MR::Vector4< T >::length ( ) const
inline

◆ lengthSq()

template<typename T >
T MR::Vector4< T >::lengthSq ( ) const
inline

◆ normalized()

template<typename T >
Vector4 MR::Vector4< T >::normalized ( ) const
inline

◆ operator*=()

template<typename T >
Vector4 & MR::Vector4< T >::operator*= ( T b)
inline

◆ operator+()

template<typename T >
const Vector4 & MR::Vector4< T >::operator+ ( ) const
inline

◆ operator+=()

template<typename T >
Vector4 & MR::Vector4< T >::operator+= ( const Vector4< T > & b)
inline

◆ operator-()

template<typename T >
Vector4 MR::Vector4< T >::operator- ( ) const
inline

◆ operator-=()

template<typename T >
Vector4 & MR::Vector4< T >::operator-= ( const Vector4< T > & b)
inline

◆ operator/=()

template<typename T >
Vector4 & MR::Vector4< T >::operator/= ( T b)
inline

◆ operator[]() [1/2]

template<typename T >
const T & MR::Vector4< T >::operator[] ( int e) const
inlineconstexprnoexcept

◆ operator[]() [2/2]

template<typename T >
T & MR::Vector4< T >::operator[] ( int e)
inlineconstexprnoexcept

◆ proj3d()

template<typename T >
Vector3< T > MR::Vector4< T >::proj3d ( ) const
inline

assuming this is a point represented in homogeneous 4D coordinates, returns the point as 3D-vector

Friends And Related Symbol Documentation

◆ div()

template<typename T >
Vector4< T > div ( const Vector4< T > & a,
const Vector4< T > & b )
related

per component division

◆ dot()

template<typename T >
T dot ( const Vector4< T > & a,
const Vector4< T > & b )
related

dot product

◆ mult()

template<typename T >
Vector4< T > mult ( const Vector4< T > & a,
const Vector4< T > & b )
related

per component multiplication

◆ operator==()

template<typename T >
bool operator== ( const Vector4< T > & a,
const Vector4< T > & b )
related

◆ sqr()

template<typename T >
T sqr ( const Vector4< T > & a)
related

squared length

Member Data Documentation

◆ elements

template<typename T >
int MR::Vector4< T >::elements = 4
staticconstexpr

◆ w

template<typename T >
T MR::Vector4< T >::w

◆ x

template<typename T >
T MR::Vector4< T >::x

◆ y

template<typename T >
T MR::Vector4< T >::y

◆ z

template<typename T >
T MR::Vector4< T >::z

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