math::vector3 Class Reference

3 element vector More...

#include <core_math.h>

List of all members.

Public Member Functions

 vector3 ()
 Create uninitialized vector.

 vector3 (scalar_t a, scalar_t b, scalar_t c)
 Create vector initialized with 3 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_tz ()
 Shortcut to vector[2].

scalar_t length3 () const
 Euclidean length of the vector.

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

vector3normalize3 ()
 Normalize vector in place.

vector3 operator+ (const vector3 &other)
 operator + between two 3-dimentional vectors

vector3operator+= (const vector3 &other)
 operator += between two 3-dimentional vectors

vector3 operator- (const vector3 &other)
 operator - between two 3-dimentional vectors

vector3operator-= (const vector3 &other)
 operator -= between two 3-dimentional vectors


Detailed Description

3 element vector


Constructor & Destructor Documentation

math::vector3::vector3  )  [inline]
 

Create uninitialized vector.

math::vector3::vector3 scalar_t  a,
scalar_t  b,
scalar_t  c
[inline]
 

Create vector initialized with 3 scalar values.


Member Function Documentation

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

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

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

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

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

Shortcut to vector[0].

Included for convenience only.

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

Shortcut to vector[1].

Included for convenience only.

scalar_t& math::vector3::z  )  [inline]
 

Shortcut to vector[2].

Included for convenience only.

scalar_t math::vector3::length3  )  const [inline]
 

Euclidean length of the vector.

scalar_t math::vector3::length3squared  )  const [inline]
 

Euclidean length of the vector, squared.

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

vector3& math::vector3::normalize3  )  [inline]
 

Normalize vector in place.

Use first 3 elements of a vector.

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

operator + between two 3-dimentional vectors

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

operator += between two 3-dimentional vectors

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

operator - between two 3-dimentional vectors

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

operator -= between two 3-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