math::vector2 Class Reference

2 element vector More...

#include <core_math.h>

List of all members.

Public Member Functions

 vector2 ()
 Create uninitialized vector.

 vector2 (scalar_t a, scalar_t b)
 Create vector initialized with 2 scalar values.

const scalar_toperator[] (int i) const
 operator [] is used to read, () is to write (to preserve const correctness)

scalar_toperator() (int i)
 () is used to write, [] is to read (to preserve const correctness)

scalar_tx ()
 Shortcut to vector[0].

scalar_ty ()
 Shortcut to vector[1].

scalar_t length2 () const
 Euclidean length of the vector.

scalar_t length2squared () const
 Euclidean length of the vector, squared.

vector2 operator+ (const vector2 &other)
 operator + between two 2-dimentional vectors

vector2operator+= (const vector2 &other)
 operator += between two 2-dimentional vectors

vector2 operator- (const vector2 &other)
 operator - between two 2-dimentional vectors

vector2operator-= (const vector2 &other)
 operator -= between two 2-dimentional vectors


Detailed Description

2 element vector


Constructor & Destructor Documentation

math::vector2::vector2  )  [inline]
 

Create uninitialized vector.

math::vector2::vector2 scalar_t  a,
scalar_t  b
[inline]
 

Create vector initialized with 2 scalar values.


Member Function Documentation

const scalar_t& math::vector2::operator[] int  i  )  const [inline]
 

operator [] is used to read, () is to write (to preserve const correctness)

scalar_t& math::vector2::operator() int  i  )  [inline]
 

() is used to write, [] is to read (to preserve const correctness)

scalar_t& math::vector2::x  )  [inline]
 

Shortcut to vector[0].

Included for convenience only.

scalar_t& math::vector2::y  )  [inline]
 

Shortcut to vector[1].

Included for convenience only.

scalar_t math::vector2::length2  )  const [inline]
 

Euclidean length of the vector.

scalar_t math::vector2::length2squared  )  const [inline]
 

Euclidean length of the vector, squared.

This is faster to compute than length, and is often sufficient for the task.

vector2 math::vector2::operator+ const vector2 other  )  [inline]
 

operator + between two 2-dimentional vectors

vector2& math::vector2::operator+= const vector2 other  )  [inline]
 

operator += between two 2-dimentional vectors

vector2 math::vector2::operator- const vector2 other  )  [inline]
 

operator - between two 2-dimentional vectors

vector2& math::vector2::operator-= const vector2 other  )  [inline]
 

operator -= between two 2-dimentional vectors


The documentation for this class was generated from the following file:
Generated on Sun May 1 17:34:32 2005 for RealityStrike Game Engine API by doxygen 1.3.6