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

#include <math/Vector3D.hpp>

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 BasicVector3D< Type > normalized () const
 
Constructors
constexpr BasicVector3D ()=default
 
constexpr BasicVector3D (const Type &x_in, const Type &y_in=0, const Type &z_in=0)
 
constexpr BasicVector3D (const BasicVector2D< Type > &other, Type z_in=0)
 
constexpr BasicVector3D (Type x_in, const BasicVector2D< Type > &other)
 
constexpr BasicVector3D (const std::tuple< Type, Type, Type > &init_value)
 
Assignment
constexpr BasicVector3D< Type > & operator= (const BasicVector3D &other)=default
 
constexpr BasicVector3D< Type > & operator= (Ref other)
 
Conversion Operators
constexpr operator std::tuple< 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 ConstRef xyz () const &
 
constexpr Ref xyz () &
 
constexpr BasicVector3D< Type > xyz () &&
 
constexpr ConstRef xzy () const &
 
constexpr Ref xzy () &
 
constexpr BasicVector3D< Type > xzy () &&
 
constexpr ConstRef zxy () const &
 
constexpr Ref zxy () &
 
constexpr BasicVector3D< Type > zxy () &&
 
constexpr ConstRef zyx () const &
 
constexpr Ref zyx () &
 
constexpr BasicVector3D< Type > zyx () &&
 

Static Public Member Functions

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

Public Attributes

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

Friends

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

Related Symbols

(Note that these are not member symbols.)

Type Aliases
using Vector3Df = BasicVector3D< float >
 
using Vector3Dd = BasicVector3D< double >
 
using Vector3D = BasicVector3D< double >
 
using Vector3Dl = BasicVector3D< long double >
 

Detailed Description

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

A simple 3D Vector class

Definition at line 25 of file Vector3D.hpp.


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