OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
Vec2< T > Struct Template Reference

#include <Vec.h>

Public Member Functions

constexpr Vec2 ()=default
 
constexpr Vec2 (T a, T b)
 
Vec2< int > toInt () const
 
auto lengthSqr () const
 
length () const
 
Vec2operator+= (const Vec2 &v)
 
Vec2operator-= (const Vec2 &v)
 

Public Attributes

x = 0
 
y = 0
 

Friends

bool operator== (const Vec2 &, const Vec2 &)=default
 
Vec2 operator+ (const Vec2 &l, const Vec2 &r)
 
Vec2 operator- (const Vec2 &l, const Vec2 &r)
 
Vec2 operator/ (const Vec2 &l, T r)
 
Vec2 operator* (const Vec2 &l, T r)
 
Vec2 operator* (T l, const Vec2 &r)
 
dot (const Vec2 &l, const Vec2 &r)
 

Constructor & Destructor Documentation

◆ Vec2() [1/2]

template<class T >
constexpr Vec2< T >::Vec2 ( )
constexprdefault

◆ Vec2() [2/2]

template<class T >
constexpr Vec2< T >::Vec2 ( a,
b 
)
inlineconstexpr

Member Function Documentation

◆ length()

template<class T >
T Vec2< T >::length ( ) const
inline

◆ lengthSqr()

template<class T >
auto Vec2< T >::lengthSqr ( ) const
inline

◆ operator+=()

template<class T >
Vec2 & Vec2< T >::operator+= ( const Vec2< T > &  v)
inline

◆ operator-=()

template<class T >
Vec2 & Vec2< T >::operator-= ( const Vec2< T > &  v)
inline

◆ toInt()

template<class T >
Vec2< int > Vec2< T >::toInt ( ) const
inline

Friends And Related Function Documentation

◆ dot

template<class T >
T dot ( const Vec2< T > &  l,
const Vec2< T > &  r 
)
friend

◆ operator* [1/2]

template<class T >
Vec2 operator* ( const Vec2< T > &  l,
r 
)
friend

◆ operator* [2/2]

template<class T >
Vec2 operator* ( l,
const Vec2< T > &  r 
)
friend

◆ operator+

template<class T >
Vec2 operator+ ( const Vec2< T > &  l,
const Vec2< T > &  r 
)
friend

◆ operator-

template<class T >
Vec2 operator- ( const Vec2< T > &  l,
const Vec2< T > &  r 
)
friend

◆ operator/

template<class T >
Vec2 operator/ ( const Vec2< T > &  l,
r 
)
friend

◆ operator==

template<class T >
bool operator== ( const Vec2< T > &  ,
const Vec2< T > &   
)
friend

Member Data Documentation

◆ x

template<class T >
T Vec2< T >::x = 0

◆ y

template<class T >
T Vec2< T >::y = 0

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