TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cherrypi::Vec2T< T > Class Template Reference

#include <basetypes.h>

Public Member Functions

constexpr Vec2T ()
 
constexpr Vec2T (T x, T y)
 
template<typename U >
 Vec2T (U const &other)
 
template<typename U >
 Vec2T (U *other)
 
template<typename U , typename V >
 Vec2T (std::pair< U, V > const &other)
 
Vec2Toperator= (Vec2T const &other)
 
bool operator== (Vec2T const &other) const
 
bool operator!= (Vec2T const &other) const
 
bool operator< (Vec2T< T > const &other) const
 
Vec2T operator+ (T scalar) const
 
Vec2T operator- (T scalar) const
 
Vec2T operator* (T scalar) const
 
Vec2T operator/ (T scalar) const
 
Vec2T operator+ (Vec2T const &other) const
 
Vec2T operator- (Vec2T const &other) const
 
Vec2Toperator+= (T scalar)
 
Vec2Toperator-= (T scalar)
 
Vec2Toperator*= (T scalar)
 
Vec2Toperator/= (T scalar)
 
Vec2Toperator+= (Vec2T const &other)
 
Vec2Toperator-= (Vec2T const &other)
 
double distanceTo (Vec2T const &other) const
 
template<typename U >
double distanceTo (U *other) const
 
double length () const
 
Vec2Tnormalize ()
 
Vec2TrotateDegrees (double degrees)
 
Vec2T project (Vec2T towards, T distance)
 
dot (Vec2T const &other)
 
template<class Archive >
void serialize (Archive &ar)
 

Static Public Member Functions

static double cos (Vec2T const &a, Vec2T const &b)
 
static T dot (Vec2T const &a, Vec2T const &b)
 
static T cross (Vec2T const &a, Vec2T const &b)
 

Public Attributes

x
 
y
 

Constructor & Destructor Documentation

template<typename T>
constexpr cherrypi::Vec2T< T >::Vec2T ( )
inline
template<typename T>
constexpr cherrypi::Vec2T< T >::Vec2T ( x,
y 
)
inline
template<typename T>
template<typename U >
cherrypi::Vec2T< T >::Vec2T ( U const &  other)
inlineexplicit
template<typename T>
template<typename U >
cherrypi::Vec2T< T >::Vec2T ( U *  other)
inlineexplicit
template<typename T>
template<typename U , typename V >
cherrypi::Vec2T< T >::Vec2T ( std::pair< U, V > const &  other)
inlineexplicit

Member Function Documentation

template<typename T>
static double cherrypi::Vec2T< T >::cos ( Vec2T< T > const &  a,
Vec2T< T > const &  b 
)
inlinestatic
template<typename T>
static T cherrypi::Vec2T< T >::cross ( Vec2T< T > const &  a,
Vec2T< T > const &  b 
)
inlinestatic
template<typename T>
double cherrypi::Vec2T< T >::distanceTo ( Vec2T< T > const &  other) const
inline
template<typename T>
template<typename U >
double cherrypi::Vec2T< T >::distanceTo ( U *  other) const
inline
template<typename T>
static T cherrypi::Vec2T< T >::dot ( Vec2T< T > const &  a,
Vec2T< T > const &  b 
)
inlinestatic
template<typename T>
T cherrypi::Vec2T< T >::dot ( Vec2T< T > const &  other)
inline
template<typename T>
double cherrypi::Vec2T< T >::length ( ) const
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::normalize ( )
inline
template<typename T>
bool cherrypi::Vec2T< T >::operator!= ( Vec2T< T > const &  other) const
inline
template<typename T>
Vec2T cherrypi::Vec2T< T >::operator* ( scalar) const
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::operator*= ( scalar)
inline
template<typename T>
Vec2T cherrypi::Vec2T< T >::operator+ ( scalar) const
inline
template<typename T>
Vec2T cherrypi::Vec2T< T >::operator+ ( Vec2T< T > const &  other) const
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::operator+= ( scalar)
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::operator+= ( Vec2T< T > const &  other)
inline
template<typename T>
Vec2T cherrypi::Vec2T< T >::operator- ( scalar) const
inline
template<typename T>
Vec2T cherrypi::Vec2T< T >::operator- ( Vec2T< T > const &  other) const
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::operator-= ( scalar)
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::operator-= ( Vec2T< T > const &  other)
inline
template<typename T>
Vec2T cherrypi::Vec2T< T >::operator/ ( scalar) const
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::operator/= ( scalar)
inline
template<typename T>
bool cherrypi::Vec2T< T >::operator< ( Vec2T< T > const &  other) const
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::operator= ( Vec2T< T > const &  other)
inline
template<typename T>
bool cherrypi::Vec2T< T >::operator== ( Vec2T< T > const &  other) const
inline
template<typename T>
Vec2T cherrypi::Vec2T< T >::project ( Vec2T< T >  towards,
distance 
)
inline
template<typename T>
Vec2T& cherrypi::Vec2T< T >::rotateDegrees ( double  degrees)
inline
template<typename T>
template<class Archive >
void cherrypi::Vec2T< T >::serialize ( Archive &  ar)
inline

Member Data Documentation

template<typename T>
T cherrypi::Vec2T< T >::x
template<typename T>
T cherrypi::Vec2T< T >::y

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