i6engine  1.0
i6e::math::i6eVector2< T > Class Template Reference

Implements 2-dimensional vectors. More...

#include <D:/Projekte/i6engine/libs/i6engine-math/include/i6engine/math/i6eVector2.h>

Public Member Functions

 i6eVector2 ()
 Creates a new vector with all values set to 0. More...
 
 i6eVector2 (const T x, const T y)
 Creates a new vector with all values set to the given values. More...
 
 i6eVector2 (const std::string &s)
 
 i6eVector2 (const std::map< std::string, std::string > &params, const std::string &prefix)
 
 ~i6eVector2 ()
 destructor More...
 
getX () const
 getters for the values of the Vector More...
 
getY () const
 
void setX (const T x)
 setters for the values of the Vector More...
 
void setY (const T y)
 
i6eVector2 operator+ (const i6eVector2 &b) const
 Operator '+' for Vectors. More...
 
i6eVector2 operator- (const i6eVector2 &b) const
 Operator '-' for Vectors. More...
 
i6eVector2 operator* (const T b) const
 operator '*' for scalars More...
 
i6eVector2 operator*= (T d)
 operator '*=' for scalars More...
 
i6eVector2 operator/ (const T b) const
 Operator '/' for Vectors with a scalar. More...
 
i6eVector2 operator+= (const i6eVector2 &b)
 Operator '+=' for Vectors. More...
 
i6eVector2 operator-= (const i6eVector2 &b)
 Operator '-=' for Vectors. More...
 
bool operator!= (const i6eVector2 &b) const
 Operator '!=' for Vector. More...
 
i6eVector2 normalize () const
 returns the normalized Vector More...
 
void insertInMap (const std::string &prefix, std::map< std::string, std::string > &map) const
 inserts this vector into an attributeMap using the given prefix More...
 
void mulComponents (const i6eVector2 &b)
 muliplies two Vectors per component More...
 
bool isValid () const
 determins whether the vector contains valid data This has to be set by the user. Operations resulting in components becoming NaN or Infinity will NOT change this flag More...
 
void setValid (bool b)
 
length () const
 length of the Vector More...
 
std::string toString () const
 converts Vector to std::string More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 serializer for the vector More...
 

Static Public Member Functions

static T scalProd (const i6eVector2 &a, const i6eVector2 &b)
 operator '*' for vectors More...
 

Static Public Attributes

static const i6eVector2 ZERO
 

Detailed Description

template<typename T>
class i6e::math::i6eVector2< T >

Implements 2-dimensional vectors.

Implements 2-dimensional vectors.

Definition at line 47 of file i6eVector2.h.

Constructor & Destructor Documentation

template<typename T>
i6e::math::i6eVector2< T >::i6eVector2 ( )
inline

Creates a new vector with all values set to 0.

Definition at line 56 of file i6eVector2.h.

template<typename T>
i6e::math::i6eVector2< T >::i6eVector2 ( const T  x,
const T  y 
)
inline

Creates a new vector with all values set to the given values.

Definition at line 62 of file i6eVector2.h.

template<typename T>
i6e::math::i6eVector2< T >::i6eVector2 ( const std::string &  s)
inlineexplicit

Definition at line 70 of file i6eVector2.h.

template<typename T>
i6e::math::i6eVector2< T >::i6eVector2 ( const std::map< std::string, std::string > &  params,
const std::string &  prefix 
)
inline

Definition at line 81 of file i6eVector2.h.

template<typename T>
i6e::math::i6eVector2< T >::~i6eVector2 ( )
inline

destructor

Definition at line 89 of file i6eVector2.h.

Member Function Documentation

template<typename T>
T i6e::math::i6eVector2< T >::getX ( ) const
inline

getters for the values of the Vector

Definition at line 95 of file i6eVector2.h.

template<typename T>
T i6e::math::i6eVector2< T >::getY ( ) const
inline

Definition at line 98 of file i6eVector2.h.

template<typename T>
void i6e::math::i6eVector2< T >::insertInMap ( const std::string &  prefix,
std::map< std::string, std::string > &  map 
) const
inline

inserts this vector into an attributeMap using the given prefix

Definition at line 194 of file i6eVector2.h.

template<typename T>
bool i6e::math::i6eVector2< T >::isValid ( ) const
inline

determins whether the vector contains valid data This has to be set by the user. Operations resulting in components becoming NaN or Infinity will NOT change this flag

Definition at line 214 of file i6eVector2.h.

template<typename T>
T i6e::math::i6eVector2< T >::length ( ) const
inline

length of the Vector

Definition at line 224 of file i6eVector2.h.

template<typename T>
void i6e::math::i6eVector2< T >::mulComponents ( const i6eVector2< T > &  b)
inline

muliplies two Vectors per component

Parameters
[in]b

Definition at line 204 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::normalize ( ) const
inline

returns the normalized Vector

Definition at line 184 of file i6eVector2.h.

template<typename T>
bool i6e::math::i6eVector2< T >::operator!= ( const i6eVector2< T > &  b) const
inline

Operator '!=' for Vector.

Definition at line 177 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::operator* ( const T  b) const
inline

operator '*' for scalars

Definition at line 129 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::operator*= ( d)
inline

operator '*=' for scalars

Definition at line 136 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::operator+ ( const i6eVector2< T > &  b) const
inline

Operator '+' for Vectors.

Definition at line 115 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::operator+= ( const i6eVector2< T > &  b)
inline

Operator '+=' for Vectors.

Definition at line 159 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::operator- ( const i6eVector2< T > &  b) const
inline

Operator '-' for Vectors.

Definition at line 122 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::operator-= ( const i6eVector2< T > &  b)
inline

Operator '-=' for Vectors.

Definition at line 168 of file i6eVector2.h.

template<typename T>
i6eVector2 i6e::math::i6eVector2< T >::operator/ ( const T  b) const
inline

Operator '/' for Vectors with a scalar.

Definition at line 152 of file i6eVector2.h.

template<typename T>
static T i6e::math::i6eVector2< T >::scalProd ( const i6eVector2< T > &  a,
const i6eVector2< T > &  b 
)
inlinestatic

operator '*' for vectors

Definition at line 145 of file i6eVector2.h.

template<typename T>
template<class Archive >
void i6e::math::i6eVector2< T >::serialize ( Archive &  ar,
const unsigned  int 
)
inline

serializer for the vector

Definition at line 244 of file i6eVector2.h.

template<typename T>
void i6e::math::i6eVector2< T >::setValid ( bool  b)
inline

Definition at line 217 of file i6eVector2.h.

template<typename T>
void i6e::math::i6eVector2< T >::setX ( const T  x)
inline

setters for the values of the Vector

Definition at line 105 of file i6eVector2.h.

template<typename T>
void i6e::math::i6eVector2< T >::setY ( const T  y)
inline

Definition at line 108 of file i6eVector2.h.

template<typename T>
std::string i6e::math::i6eVector2< T >::toString ( ) const
inline

converts Vector to std::string

converts the vector to a std::string using the Format "x y z"

Definition at line 233 of file i6eVector2.h.

Member Data Documentation

template<typename T>
const i6eVector2< T > i6e::math::i6eVector2< T >::ZERO
static

Definition at line 51 of file i6eVector2.h.


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