math::vector4 Class Reference

4 element vector More...

#include <core_math.h>

List of all members.

Public Member Functions

 vector4 ()
 Create uninitialized vector.

 vector4 (scalar_t a, scalar_t b, scalar_t c, scalar_t d=1)
 Create vector initialized with 3 (or, optionally, 4) scalar values.

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

scalar_toperator() (int i)
 operator () 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_tw ()
 Shortcut to vector[3].

scalar_t length3 () const
 Euclidean length of the vector (only first 3 elements of the vector are used for calculation).

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

vector4normalize3 ()
 Normalize vector in place.

vector4 operator+ (const vector4 &other)
 operator + between two 4-dimentional vectors

vector4operator+= (const vector4 &other)
 operator += between two 4-dimentional vectors

vector4 operator- (const vector4 &other)
 operator - between two 4-dimentional vectors

vector4operator-= (const vector4 &other)
 operator -= between two 4-dimentional vectors


Detailed Description

4 element vector


Constructor & Destructor Documentation

math::vector4::vector4  )  [inline]
 

Create uninitialized vector.

math::vector4::vector4 scalar_t  a,
scalar_t  b,
scalar_t  c,
scalar_t  d = 1
[inline]
 

Create vector initialized with 3 (or, optionally, 4) scalar values.

Note:
If only 3 values are specified - fourth value is initialized to "1".


Member Function Documentation

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

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

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

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

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

Shortcut to vector[0].

Included for convenience only.

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

Shortcut to vector[1].

Included for convenience only.

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

Shortcut to vector[2].

Included for convenience only.

scalar_t& math::vector4::w  )  [inline]
 

Shortcut to vector[3].

Included for convenience only.

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

Euclidean length of the vector (only first 3 elements of the vector are used for calculation).

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

Euclidean length of the vector, squared.

This is faster to compute than length, and is often sufficient for the task. Only 3 first elements of the vector are used for calculation.

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

Normalize vector in place.

Use first 3 elements of a vector. In result vector[4] will be set to value 1.

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

operator + between two 4-dimentional vectors

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

operator += between two 4-dimentional vectors

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

operator - between two 4-dimentional vectors

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

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