i6engine  1.0
i6e::math::i6eVector Class Reference

Implements 3-dimensional vectors. More...

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

Public Member Functions

 i6eVector ()
 Creates a new vector with all values set to 0. More...
 
 i6eVector (const double x, const double y, const double z)
 Creates a new vector with all values set to the given values. More...
 
 i6eVector (const Ogre::Vector3 &ogre)
 Copy constructor with vector from Ogre. More...
 
 i6eVector (const btVector3 &bullet)
 Copy constructor with vector from Bullet. More...
 
 i6eVector (const std::string &s)
 
 i6eVector (const std::map< std::string, std::string > &params, const std::string &prefix)
 
 ~i6eVector ()
 destructor More...
 
double getX () const
 getters for the values of the Vector More...
 
double getY () const
 
double getZ () const
 
void setX (const double x)
 setters for the values of the Vector More...
 
void setY (const double y)
 
void setZ (const double z)
 
i6eVector operator+ (const i6eVector &b) const
 Operator '+' for Vectors. More...
 
i6eVector operator- (const i6eVector &b) const
 Operator '-' for Vectors. More...
 
i6eVector operator* (const i6eVector &b) const
 operator '*' for vectors More...
 
i6eVector operator* (const double b) const
 operator '*' for scalars More...
 
i6eVector operator/ (const double b) const
 Operator '/' for Vectors with a scalar. More...
 
i6eVector operator+= (const i6eVector &b)
 Operator '+=' for Vectors. More...
 
i6eVector operator-= (const i6eVector &b)
 Operator '-=' for Vectors. More...
 
bool operator== (const i6eVector &b) const
 Operator '==' for Vector. More...
 
bool operator!= (const i6eVector &b) const
 Operator '!=' for Vector. More...
 
i6eVector 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 i6eVector &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)
 
double length () const
 length of the Vector More...
 
Ogre::Vector3 toOgre () const
 Convert whole vector to Ogre. More...
 
Ogre::Vector2 toOgre2 () const
 Convert x and z values to a 2-dimensional vector in Ogre. More...
 
btVector3 toBullet () const
 Convert whole vector to Bullet. 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 double scalProd (const i6eVector &a, const i6eVector &b)
 operator '*' for vectors More...
 
static i6eVector crossProd (const i6eVector &a, const i6eVector &b)
 Operator '*' for Vectors (cross product) More...
 
static double crossAngle (const i6eVector &a, const i6eVector &b)
 angle between two vectors More...
 
static double crossAngleSigned (const i6eVector &a, const i6eVector &b, const i6eVector &n)
 signed angle between two vectors More...
 

Static Public Attributes

static const i6eVector ZERO
 

Detailed Description

Implements 3-dimensional vectors.

Implements 3-dimensional vectors. Conversion of vectors from Ogre and Bullet possible.

Definition at line 48 of file i6eVector.h.

Constructor & Destructor Documentation

i6e::math::i6eVector::i6eVector ( )
inline

Creates a new vector with all values set to 0.

Definition at line 57 of file i6eVector.h.

i6e::math::i6eVector::i6eVector ( const double  x,
const double  y,
const double  z 
)
inline

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

Definition at line 63 of file i6eVector.h.

i6e::math::i6eVector::i6eVector ( const Ogre::Vector3 &  ogre)
explicit

Copy constructor with vector from Ogre.

Parameters
[in]ogreVector to copy
i6e::math::i6eVector::i6eVector ( const btVector3 &  bullet)
explicit

Copy constructor with vector from Bullet.

Parameters
[in]bulletVector to copy
i6e::math::i6eVector::i6eVector ( const std::string &  s)
explicit
i6e::math::i6eVector::i6eVector ( const std::map< std::string, std::string > &  params,
const std::string &  prefix 
)
i6e::math::i6eVector::~i6eVector ( )
inline

destructor

Definition at line 98 of file i6eVector.h.

Member Function Documentation

static double i6e::math::i6eVector::crossAngle ( const i6eVector a,
const i6eVector b 
)
static

angle between two vectors

Parameters
[in]afirst vector
[in]bsecond vector
Returns
angle as a value between [0; PI]
static double i6e::math::i6eVector::crossAngleSigned ( const i6eVector a,
const i6eVector b,
const i6eVector n 
)
static

signed angle between two vectors

Parameters
[in]astarting vector
[in]bend vector
[in]nnormal vector of plan containing a and b
Returns
angle as a value between ]-PI; PI]
static i6eVector i6e::math::i6eVector::crossProd ( const i6eVector a,
const i6eVector b 
)
inlinestatic

Operator '*' for Vectors (cross product)

Definition at line 209 of file i6eVector.h.

double i6e::math::i6eVector::getX ( ) const
inline

getters for the values of the Vector

Definition at line 104 of file i6eVector.h.

double i6e::math::i6eVector::getY ( ) const
inline

Definition at line 107 of file i6eVector.h.

double i6e::math::i6eVector::getZ ( ) const
inline

Definition at line 110 of file i6eVector.h.

void i6e::math::i6eVector::insertInMap ( const std::string &  prefix,
std::map< std::string, std::string > &  map 
) const

inserts this vector into an attributeMap using the given prefix

bool i6e::math::i6eVector::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

double i6e::math::i6eVector::length ( ) const

length of the Vector

void i6e::math::i6eVector::mulComponents ( const i6eVector b)
inline

muliplies two Vectors per component

Parameters
b

Definition at line 239 of file i6eVector.h.

i6eVector i6e::math::i6eVector::normalize ( ) const

returns the normalized Vector

bool i6e::math::i6eVector::operator!= ( const i6eVector b) const
inline

Operator '!=' for Vector.

Definition at line 197 of file i6eVector.h.

i6eVector i6e::math::i6eVector::operator* ( const i6eVector b) const
inline

operator '*' for vectors

Definition at line 144 of file i6eVector.h.

i6eVector i6e::math::i6eVector::operator* ( const double  b) const
inline

operator '*' for scalars

Definition at line 151 of file i6eVector.h.

i6eVector i6e::math::i6eVector::operator+ ( const i6eVector b) const
inline

Operator '+' for Vectors.

Definition at line 130 of file i6eVector.h.

i6eVector i6e::math::i6eVector::operator+= ( const i6eVector b)
inline

Operator '+=' for Vectors.

Definition at line 172 of file i6eVector.h.

i6eVector i6e::math::i6eVector::operator- ( const i6eVector b) const
inline

Operator '-' for Vectors.

Definition at line 137 of file i6eVector.h.

i6eVector i6e::math::i6eVector::operator-= ( const i6eVector b)
inline

Operator '-=' for Vectors.

Definition at line 182 of file i6eVector.h.

i6eVector i6e::math::i6eVector::operator/ ( const double  b) const
inline

Operator '/' for Vectors with a scalar.

Definition at line 165 of file i6eVector.h.

bool i6e::math::i6eVector::operator== ( const i6eVector b) const

Operator '==' for Vector.

static double i6e::math::i6eVector::scalProd ( const i6eVector a,
const i6eVector b 
)
inlinestatic

operator '*' for vectors

Definition at line 158 of file i6eVector.h.

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

serializer for the vector

Definition at line 290 of file i6eVector.h.

void i6e::math::i6eVector::setValid ( bool  b)
void i6e::math::i6eVector::setX ( const double  x)
inline

setters for the values of the Vector

Definition at line 117 of file i6eVector.h.

void i6e::math::i6eVector::setY ( const double  y)
inline

Definition at line 120 of file i6eVector.h.

void i6e::math::i6eVector::setZ ( const double  z)
inline

Definition at line 123 of file i6eVector.h.

btVector3 i6e::math::i6eVector::toBullet ( ) const

Convert whole vector to Bullet.

Returns
Vector converted to Bullet
Ogre::Vector3 i6e::math::i6eVector::toOgre ( ) const

Convert whole vector to Ogre.

Returns
Vector converted to Ogre
Ogre::Vector2 i6e::math::i6eVector::toOgre2 ( ) const

Convert x and z values to a 2-dimensional vector in Ogre.

Returns
2-dimensional vector converted to Ogre
std::string i6e::math::i6eVector::toString ( ) const

converts Vector to std::string

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

Member Data Documentation

const i6eVector i6e::math::i6eVector::ZERO
static

Definition at line 52 of file i6eVector.h.


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