BasicVector4< Element > Class Template Reference

#include <Vector4.h>

Collaboration diagram for BasicVector4< Element >:
Collaboration graph
[legend]

Public Member Functions

 BasicVector4 ()
 BasicVector4 (Element x_, Element y_, Element z_, Element w_)
 BasicVector4 (const BasicVector3< Element > &self, Element w_)
Element & x ()
Element & y ()
Element & z ()
Element & w ()
const Element & x () const
const Element & y () const
const Element & z () const
const Element & w () const
Element index (std::size_t i) const
Element & index (std::size_t i)
bool operator== (const BasicVector4 &other) const
bool operator!= (const BasicVector4 &other) const
template<typename OtherElement >
BasicVector4< Element > operator+ (const BasicVector4< OtherElement > &other) const
template<typename OtherElement >
void operator+= (const BasicVector4< OtherElement > &other)
template<typename OtherElement >
BasicVector4< Element > operator- (const BasicVector4< OtherElement > &other) const
template<typename OtherElement >
void operator-= (const BasicVector4< OtherElement > &other)
template<typename OtherElement >
BasicVector4< Element > operator* (const BasicVector4< OtherElement > &other) const
template<typename OtherElement >
void operator*= (const BasicVector4< OtherElement > &other)
template<typename OtherElement >
BasicVector4< Element > operator* (const OtherElement &other) const
template<typename OtherElement >
void operator*= (const OtherElement &other)
template<typename OtherElement >
BasicVector4< Element > operator/ (const BasicVector4< OtherElement > &other) const
template<typename OtherElement >
void operator/= (const BasicVector4< OtherElement > &other)
template<typename OtherElement >
BasicVector4< Element > operator/ (const OtherElement &other) const
template<typename OtherElement >
void operator/= (const OtherElement &other)
template<typename OtherT >
Element dot (const BasicVector4< OtherT > &other) const
BasicVector3< Element > getProjected ()
std::string toString () const
 operator const Element * () const
 operator Element * ()
BasicVector3< Element > & getVector3 ()
const BasicVector3< Element > & getVector3 () const

Private Attributes

Element m_elements [4]

Detailed Description

template<typename Element>
class BasicVector4< Element >

Definition at line 22 of file Vector4.h.


Constructor & Destructor Documentation

template<typename Element>
BasicVector4< Element >::BasicVector4 (  )  [inline]

Definition at line 27 of file Vector4.h.

template<typename Element>
BasicVector4< Element >::BasicVector4 ( Element  x_,
Element  y_,
Element  z_,
Element  w_ 
) [inline]

Definition at line 32 of file Vector4.h.

template<typename Element>
BasicVector4< Element >::BasicVector4 ( const BasicVector3< Element > &  self,
Element  w_ 
) [inline]

Definition at line 41 of file Vector4.h.


Member Function Documentation

template<typename Element>
template<typename OtherT >
Element BasicVector4< Element >::dot ( const BasicVector4< OtherT > &  other  )  const [inline]

Definition at line 244 of file Vector4.h.

template<typename Element>
BasicVector3<Element> BasicVector4< Element >::getProjected (  )  [inline]

Project this homogeneous Vector4 into a Cartesian Vector3 by dividing by w.

Returns:
A Vector3 representing the Cartesian equivalent of this homogeneous vector.

Definition at line 257 of file Vector4.h.

template<typename Element>
const BasicVector3<Element>& BasicVector4< Element >::getVector3 (  )  const [inline]

Definition at line 296 of file Vector4.h.

template<typename Element>
BasicVector3<Element>& BasicVector4< Element >::getVector3 (  )  [inline]

Definition at line 291 of file Vector4.h.

Referenced by viewer_from_transformed_viewer().

template<typename Element>
Element& BasicVector4< Element >::index ( std::size_t  i  )  [inline]

Definition at line 89 of file Vector4.h.

template<typename Element>
Element BasicVector4< Element >::index ( std::size_t  i  )  const [inline]

Definition at line 85 of file Vector4.h.

template<typename Element>
BasicVector4< Element >::operator const Element * (  )  const [inline]

Implicit cast to C-style array. This allows a Vector4 to be passed directly to GL functions that expect an array (e.g. glFloat4fv()). These functions implicitly provide operator[] as well, since the C-style array provides this function.

Definition at line 279 of file Vector4.h.

template<typename Element>
BasicVector4< Element >::operator Element * (  )  [inline]

Definition at line 284 of file Vector4.h.

template<typename Element>
bool BasicVector4< Element >::operator!= ( const BasicVector4< Element > &  other  )  const [inline]

Compare this BasicVector4 against another for inequality.

Definition at line 103 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
BasicVector4<Element> BasicVector4< Element >::operator* ( const OtherElement &  other  )  const [inline]

Definition at line 176 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
BasicVector4<Element> BasicVector4< Element >::operator* ( const BasicVector4< OtherElement > &  other  )  const [inline]

Definition at line 157 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
void BasicVector4< Element >::operator*= ( const OtherElement &  other  )  [inline]

Definition at line 184 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
void BasicVector4< Element >::operator*= ( const BasicVector4< OtherElement > &  other  )  [inline]

Definition at line 165 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
BasicVector4<Element> BasicVector4< Element >::operator+ ( const BasicVector4< OtherElement > &  other  )  const [inline]

Definition at line 112 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
void BasicVector4< Element >::operator+= ( const BasicVector4< OtherElement > &  other  )  [inline]

Definition at line 120 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
BasicVector4<Element> BasicVector4< Element >::operator- ( const BasicVector4< OtherElement > &  other  )  const [inline]

Definition at line 132 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
void BasicVector4< Element >::operator-= ( const BasicVector4< OtherElement > &  other  )  [inline]

Definition at line 140 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
BasicVector4<Element> BasicVector4< Element >::operator/ ( const OtherElement &  other  )  const [inline]

Definition at line 216 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
BasicVector4<Element> BasicVector4< Element >::operator/ ( const BasicVector4< OtherElement > &  other  )  const [inline]

Definition at line 197 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
void BasicVector4< Element >::operator/= ( const OtherElement &  other  )  [inline]

Definition at line 224 of file Vector4.h.

template<typename Element>
template<typename OtherElement >
void BasicVector4< Element >::operator/= ( const BasicVector4< OtherElement > &  other  )  [inline]

Definition at line 205 of file Vector4.h.

template<typename Element>
bool BasicVector4< Element >::operator== ( const BasicVector4< Element > &  other  )  const [inline]

Compare this BasicVector4 against another for equality.

Definition at line 96 of file Vector4.h.

template<typename Element>
std::string BasicVector4< Element >::toString (  )  const [inline]
Returns:
String representation of the vector - values are separated by space

Definition at line 266 of file Vector4.h.

template<typename Element>
const Element& BasicVector4< Element >::w (  )  const [inline]

Definition at line 80 of file Vector4.h.

template<typename Element>
Element& BasicVector4< Element >::w (  )  [inline]

Definition at line 62 of file Vector4.h.

Referenced by BasicVector4< float >::dot(), and vector4_equal_epsilon().

template<typename Element>
const Element& BasicVector4< Element >::x (  )  const [inline]

Definition at line 68 of file Vector4.h.

template<typename Element>
Element& BasicVector4< Element >::x (  )  [inline]
template<typename Element>
const Element& BasicVector4< Element >::y (  )  const [inline]

Definition at line 72 of file Vector4.h.

template<typename Element>
Element& BasicVector4< Element >::y (  )  [inline]
template<typename Element>
const Element& BasicVector4< Element >::z (  )  const [inline]

Definition at line 76 of file Vector4.h.

template<typename Element>
Element& BasicVector4< Element >::z (  )  [inline]

Field Documentation

template<typename Element>
Element BasicVector4< Element >::m_elements[4] [private]

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

Generated by  doxygen 1.6.2