MathLib
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
BasicVector4D< Type > Struct Template Reference

#include <math/Vector4D.hp>

Classes

struct  BasicRef
 

Public Types

using Ref = BasicRef< Type >
 
using ConstRef = BasicRef< const Type >
 
Types
using value_type = Type
 The underlying implementation type.
 

Public Member Functions

constexpr value_type normSquared () const
 
constexpr value_type norm () const
 
constexpr value_type magnitudeSquared () const
 
constexpr value_type magnitude () const
 
constexpr BasicVector4D< Type > normalized () const
 
Constructors
constexpr BasicVector4D ()=default
 
constexpr BasicVector4D (const Type &x_in, const Type &y_in=0, const Type &z_in=0, const Type &w_in=0)
 
constexpr BasicVector4D (const BasicVector3D< Type > &first3, const Type &w_in=0)
 
constexpr BasicVector4D (const BasicVector2D< Type > &first2, const BasicVector2D< Type > &second2)
 
constexpr BasicVector4D (const Type &x_in, const BasicVector3D< Type > &last3)
 
Assignment
constexpr BasicVector4D< Type > & operator= (const BasicVector4D &other)=default
 
constexpr BasicVector4D< Type > & operator= (Ref other)
 
Conversion Operators
constexpr operator std::tuple< Type, Type, Type, Type > () const
 
Invalid Value Check
bool isNaN () const
 
bool isInf () const
 
Swizzle operations
constexpr BasicVector2D< Type >::ConstRef xy () const &
 
constexpr BasicVector2D< Type >::Ref xy () &
 
constexpr BasicVector2D< Type > xy () &&
 
constexpr BasicVector2D< Type >::ConstRef xz () const &
 
constexpr BasicVector2D< Type >::Ref xz () &
 
constexpr BasicVector2D< Type > xz () &&
 
constexpr BasicVector2D< Type >::ConstRef yx () const &
 
constexpr BasicVector2D< Type >::Ref yx () &
 
constexpr BasicVector2D< Type > yx () &&
 
constexpr BasicVector2D< Type >::ConstRef yz () const &
 
constexpr BasicVector2D< Type >::Ref yz () &
 
constexpr BasicVector2D< Type > yz () &&
 
constexpr BasicVector2D< Type >::ConstRef zx () const &
 
constexpr BasicVector2D< Type >::Ref zx () &
 
constexpr BasicVector2D< Type > zx () &&
 
constexpr BasicVector3D< Type >::ConstRef xyz () const &
 
constexpr BasicVector3D< Type >::Ref xyz () &
 
constexpr BasicVector3D< Type > xyz () &&
 
constexpr BasicVector3D< Type >::ConstRef xzy () const &
 
constexpr BasicVector3D< Type >::Ref xzy () &
 
constexpr BasicVector3D< Type > xzy () &&
 
constexpr BasicVector3D< Type >::ConstRef zxy () const &
 
constexpr BasicVector3D< Type >::Ref zxy () &
 
constexpr BasicVector3D< Type > zxy () &&
 
constexpr BasicVector3D< Type >::ConstRef zyx () const &
 
constexpr BasicVector3D< Type >::Ref zyx () &
 
constexpr BasicVector3D< Type > zyx () &&
 
constexpr BasicVector3D< Type >::ConstRef xxx () const &
 
constexpr BasicVector3D< Type >::Ref xxx () &
 
constexpr BasicVector3D< Type > xxx () &&
 
constexpr BasicVector3D< Type >::ConstRef yyy () const &
 
constexpr BasicVector3D< Type >::Ref yyy () &
 
constexpr BasicVector3D< Type > yyy () &&
 
constexpr BasicVector3D< Type >::ConstRef zzz () const &
 
constexpr BasicVector3D< Type >::Ref zzz () &
 
constexpr BasicVector3D< Type > zzz () &&
 
constexpr BasicVector3D< Type >::ConstRef www () const &
 
constexpr BasicVector3D< Type >::Ref www () &
 
constexpr BasicVector3D< Type > www () &&
 

Static Public Member Functions

Constants
static constexpr BasicVector4D< Type > unit_x ()
 
static constexpr BasicVector4D< Type > unit_y ()
 
static constexpr BasicVector4D< Type > unit_z ()
 
static constexpr BasicVector4D< Type > unit_w ()
 
static constexpr BasicVector4D< Type > zero ()
 

Public Attributes

Element Access
value_type x {}
 
value_type y {}
 
value_type z {}
 
value_type w {}
 

Friends

Equality
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr bool operator== (const BasicVector4D &left, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr bool operator== (const BasicVector4D &left, BasicRef< U > right)
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
constexpr bool approximately_equal_to (const BasicVector4D &value_to_test, const BasicVector4D< U > &value_it_should_be, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
constexpr bool approximately_equal_to (const BasicVector4D &value_to_test, BasicRef< U > value_it_should_be, OT tolerance=OT{0.0002})
 
Operators
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator+ (const BasicVector4D &left, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator+ (const BasicVector4D &left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator- (const BasicVector4D &left, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator- (const BasicVector4D &left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator* (const BasicVector4D &left, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator* (const BasicVector4D &left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator* (const BasicVector4D &left, const U &scalar)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator* (const U &scalar, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator/ (const BasicVector4D &left, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator/ (const BasicVector4D &left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > operator/ (const BasicVector4D< Type > &left, const U &right)
 
Global Functions
constexpr Type accumulate (const BasicVector4D< Type > &input)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot (const BasicVector4D &left, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot (const BasicVector4D &left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot_normalized (const BasicVector4D &left, const BasicVector4D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot_normalized (const BasicVector4D &left, BasicRef< U > right)
 
constexpr BasicVector4D< Type > normalized (const BasicVector4D< Type > &input)
 
constexpr BasicVector4D< Type > abs (const BasicVector4D< Type > &input)
 
BasicVector4D< Type > fract (const BasicVector4D< Type > &input)
 
constexpr BasicVector4D< Type > saturate (const BasicVector4D< Type > &input, Type lower_bound, Type upper_bound)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > lerp (const BasicVector4D &input_lower_bound, const BasicVector4D< U > &input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > lerp (const BasicVector4D &input_lower_bound, BasicRef< U > input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > mix (const BasicVector4D &input_lower_bound, const BasicVector4D< U > &input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector4D< Type > mix (const BasicVector4D &input_lower_bound, BasicRef< U > input_upper_bound, float percentage_zero_to_one)
 
std::string format (const BasicVector4D &input)
 
Check
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
bool check_if_equal (const BasicVector4D &input, const BasicVector4D< U > &near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
bool check_if_equal (const BasicVector4D &input, BasicRef< U > near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
bool check_if_not_equal (const BasicVector4D &input, const BasicVector4D< U > &near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
bool check_if_not_equal (const BasicVector4D &input, BasicRef< U > near_to, OT tolerance=OT{0.0002})
 
Assert
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
void CHECK_IF_EQUAL (const BasicVector4D &input, const BasicVector4D< U > &near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
void CHECK_IF_EQUAL (const BasicVector4D &input, BasicRef< U > near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
void CHECK_IF_NOT_EQUAL (const BasicVector4D &input, const BasicVector4D< U > &near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
void CHECK_IF_NOT_EQUAL (const BasicVector4D &input, BasicRef< U > near_to, OT tolerance=OT{0.0002})
 
template<std::floating_point OT = float>
void CHECK_IF_ZERO (const BasicVector4D< Type > &input, OT tolerance=OT{0.0002})
 

Related Symbols

(Note that these are not member symbols.)

Type Aliases
using Vector4Df = BasicVector4D< float >
 
using Vector4Dd = BasicVector4D< double >
 
using Vector4D = BasicVector4D< double >
 
using Vector4Dl = BasicVector4D< long double >
 

Detailed Description

template<class Type>
struct Math::BasicVector4D< Type >

A simple 4D Vector class

Definition at line 24 of file Vector4D.hpp.


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