wren
Vulkan-based game engine
Loading...
Searching...
No Matches
wren::math::Vec< T, N > Struct Template Reference

#include <vector.hpp>

Public Types

using vec_t = Vec<T, N>
 

Public Member Functions

 Vec ()
 
 Vec (std::array< T, N > data)
 
 Vec (float scalar)
 
template<typename... Args>
requires (sizeof...(Args) > 1)
 Vec (Args... args)
 
auto xyz () const
 
auto at (std::size_t i) -> T &
 
auto at (std::size_t i) const
 
constexpr auto operator*= (float scalar) const
 
constexpr auto operator* (float scalar) const
 
constexpr auto operator*= (const vec_t &other)
 
constexpr auto operator* (const vec_t &other) const
 
constexpr auto dot (const vec_t &other) const
 
constexpr auto operator+= (const vec_t &other)
 
constexpr auto operator+ (const vec_t &other) const
 
constexpr auto operator-= (const vec_t &other)
 
constexpr auto operator- (const vec_t &other) const
 
constexpr auto operator- () const
 
auto operator/ (float scalar) const
 
constexpr auto operator== (const vec_t &other) const
 
constexpr auto operator!= (const vec_t &other) const
 
constexpr auto length () const
 
auto normalized () const
 

Static Public Member Functions

static auto unit_x ()
 
static auto unit_y ()
 
static auto unit_z ()
 

Public Attributes

std::array< T, N > data {}
 

Member Typedef Documentation

◆ vec_t

template<typename T , std::size_t N>
using wren::math::Vec< T, N >::vec_t = Vec<T, N>

Constructor & Destructor Documentation

◆ Vec() [1/4]

template<typename T , std::size_t N>
wren::math::Vec< T, N >::Vec ( )
inline

◆ Vec() [2/4]

template<typename T , std::size_t N>
wren::math::Vec< T, N >::Vec ( std::array< T, N > data)
inline

◆ Vec() [3/4]

template<typename T , std::size_t N>
wren::math::Vec< T, N >::Vec ( float scalar)
inline

◆ Vec() [4/4]

template<typename T , std::size_t N>
template<typename... Args>
requires (sizeof...(Args) > 1)
wren::math::Vec< T, N >::Vec ( Args... args)
inline

Member Function Documentation

◆ at() [1/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::at ( std::size_t i) -> T&
inline
Here is the caller graph for this function:

◆ at() [2/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::at ( std::size_t i) const
inlinenodiscard

◆ dot()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::dot ( const vec_t & other) const
inlinenodiscardconstexpr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ length()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::length ( ) const
inlinenodiscardconstexpr
Here is the caller graph for this function:

◆ normalized()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::normalized ( ) const
inlinenodiscard
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator!= ( const vec_t & other) const
inlineconstexpr

◆ operator*() [1/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator* ( const vec_t & other) const
inlineconstexpr

◆ operator*() [2/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator* ( float scalar) const
inlineconstexpr

◆ operator*=() [1/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator*= ( const vec_t & other)
inlineconstexpr

◆ operator*=() [2/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator*= ( float scalar) const
inlineconstexpr

◆ operator+()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator+ ( const vec_t & other) const
inlineconstexpr

◆ operator+=()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator+= ( const vec_t & other)
inlineconstexpr

◆ operator-() [1/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator- ( ) const
inlineconstexpr

◆ operator-() [2/2]

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator- ( const vec_t & other) const
inlineconstexpr

◆ operator-=()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator-= ( const vec_t & other)
inlineconstexpr

◆ operator/()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator/ ( float scalar) const
inline

◆ operator==()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::operator== ( const vec_t & other) const
inlineconstexpr

◆ unit_x()

template<typename T , std::size_t N>
static auto wren::math::Vec< T, N >::unit_x ( )
inlinestatic

◆ unit_y()

template<typename T , std::size_t N>
static auto wren::math::Vec< T, N >::unit_y ( )
inlinestatic

◆ unit_z()

template<typename T , std::size_t N>
static auto wren::math::Vec< T, N >::unit_z ( )
inlinestatic

◆ xyz()

template<typename T , std::size_t N>
auto wren::math::Vec< T, N >::xyz ( ) const
inlinenodiscard

Member Data Documentation

◆ data

template<typename T , std::size_t N>
std::array<T, N> wren::math::Vec< T, N >::data {}

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