Keos::CVector2< T > Class Template Reference

Standard 2-dimensional vector with customizable type. More...

#include <KeosVector2.h>

List of all members.

Public Member Functions

 CVector2 (T X=0, T Y=0)
 Default constructor.
void Set (T X, T Y)
 Set vector.
Length () const
 Returns the length (magnitude) of the vector (sqrt(x² + y²)).
LengthSq () const
 Returns the square of the length(magnitude) of the vector (x² + y²).
void Normalize ()
 Normalizes the vector.
CVector2< T > operator+ () const
CVector2< T > operator- () const
CVector2< T > operator+ (const CVector2< T > &v) const
CVector2< T > operator- (const CVector2< T > &v) const
const CVector2< T > & operator+= (const CVector2< T > &v)
const CVector2< T > & operator-= (const CVector2< T > &v)
CVector2< T > operator * (T t) const
CVector2< T > operator/ (T t) const
const CVector2< T > & operator *= (T t)
const CVector2< T > & operator/= (T t)
bool operator== (const CVector2< T > &v) const
bool operator!= (const CVector2< T > &v) const
 operator T * ()
 T* cast operator.

Public Attributes

x
y


Detailed Description

template<class T>
class Keos::CVector2< T >

Standard 2-dimensional vector with customizable type.

Definition at line 34 of file KeosVector2.h.


Constructor & Destructor Documentation

template<class T>
Keos::CVector2< T >::CVector2 ( X = 0,
Y = 0 
) [inline]

Default constructor.

Definition at line 106 of file KeosVector2.h.


Member Function Documentation

template<class T>
void Keos::CVector2< T >::Set ( X,
Y 
) [inline]

Set vector.

Definition at line 113 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

Referenced by Keos::CRectangle::Set().

template<class T>
T Keos::CVector2< T >::Length (  )  const [inline]

Returns the length (magnitude) of the vector (sqrt(x² + y²)).

Definition at line 121 of file KeosVector2.h.

References Keos::CVector2< T >::LengthSq().

Referenced by Keos::CVector2< T >::Normalize().

template<class T>
T Keos::CVector2< T >::LengthSq (  )  const [inline]

Returns the square of the length(magnitude) of the vector (x² + y²).

Definition at line 128 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

Referenced by Keos::CVector2< T >::Length().

template<class T>
void Keos::CVector2< T >::Normalize (  )  [inline]

Normalizes the vector.

Definition at line 135 of file KeosVector2.h.

References Keos::CVector2< T >::Length(), Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
CVector2< T > Keos::CVector2< T >::operator+ (  )  const [inline]

Definition at line 148 of file KeosVector2.h.

template<class T>
CVector2< T > Keos::CVector2< T >::operator- (  )  const [inline]

Definition at line 155 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
CVector2< T > Keos::CVector2< T >::operator+ ( const CVector2< T > &  v  )  const [inline]

Definition at line 162 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
CVector2< T > Keos::CVector2< T >::operator- ( const CVector2< T > &  v  )  const [inline]

Definition at line 169 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
const CVector2< T > & Keos::CVector2< T >::operator+= ( const CVector2< T > &  v  )  [inline]

Definition at line 176 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
const CVector2< T > & Keos::CVector2< T >::operator-= ( const CVector2< T > &  v  )  [inline]

Definition at line 186 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
CVector2< T > Keos::CVector2< T >::operator * ( t  )  const [inline]

Definition at line 196 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
CVector2< T > Keos::CVector2< T >::operator/ ( t  )  const [inline]

Definition at line 203 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
const CVector2< T > & Keos::CVector2< T >::operator *= ( t  )  [inline]

Definition at line 210 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
const CVector2< T > & Keos::CVector2< T >::operator/= ( t  )  [inline]

Definition at line 220 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
bool Keos::CVector2< T >::operator== ( const CVector2< T > &  v  )  const [inline]

Definition at line 230 of file KeosVector2.h.

References Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

template<class T>
bool Keos::CVector2< T >::operator!= ( const CVector2< T > &  v  )  const [inline]

Definition at line 238 of file KeosVector2.h.

template<class T>
Keos::CVector2< T >::operator T * (  )  [inline]

T* cast operator.

Returns:
Pointer on the vector components.

Definition at line 245 of file KeosVector2.h.

References Keos::CVector2< T >::x.


Member Data Documentation

template<class T>
T Keos::CVector2< T >::x

Definition at line 83 of file KeosVector2.h.

Referenced by Keos::CGraphicString::Align(), Keos::Console::CLookDefault::CLookDefault(), Keos::CImage::CopyImage(), Keos::COGLRenderSystem::CreateTexture(), Keos::CD3D9RenderSystem::CreateTexture(), Keos::CImage::Flip(), Keos::CImage::GetPixel(), Keos::CFontManager::GetStringPixelSize(), Keos::CRectangle::Intersects(), Keos::CRectangle::Left(), Keos::CVector2< T >::LengthSq(), Keos::CImage::Mirror(), Keos::CVector2< T >::Normalize(), Keos::CVector2< T >::operator *(), Keos::CVector2< T >::operator *=(), Keos::CVector2< T >::operator T *(), Keos::CVector2< T >::operator+(), Keos::CVector2< T >::operator+=(), Keos::CVector2< T >::operator-(), Keos::CVector2< T >::operator-=(), Keos::CVector2< T >::operator/(), Keos::CVector2< T >::operator/=(), Keos::CVector2< T >::operator==(), Keos::operator>>(), Keos::CRectangle::Right(), Keos::CImagesLoader::SaveToFile(), Keos::CVector2< T >::Set(), Keos::CShader::SetParameter(), Keos::CImage::SetPixel(), Keos::CImage::SubImage(), Keos::VectorDot(), and Keos::CRectangle::Width().

template<class T>
T Keos::CVector2< T >::y

Definition at line 83 of file KeosVector2.h.

Referenced by Keos::CGraphicString::Align(), Keos::CRectangle::Bottom(), Keos::Console::CLookDefault::CLookDefault(), Keos::CImage::CopyImage(), Keos::COGLRenderSystem::CreateTexture(), Keos::CD3D9RenderSystem::CreateTexture(), Keos::CImage::Flip(), Keos::CFontManager::GetStringPixelSize(), Keos::CRectangle::Height(), Keos::CRectangle::Intersects(), Keos::CVector2< T >::LengthSq(), Keos::CImage::Mirror(), Keos::CVector2< T >::Normalize(), Keos::CVector2< T >::operator *(), Keos::CVector2< T >::operator *=(), Keos::CVector2< T >::operator+(), Keos::CVector2< T >::operator+=(), Keos::CVector2< T >::operator-(), Keos::CVector2< T >::operator-=(), Keos::CVector2< T >::operator/(), Keos::CVector2< T >::operator/=(), Keos::CVector2< T >::operator==(), Keos::operator>>(), Keos::CImagesLoader::SaveToFile(), Keos::CVector2< T >::Set(), Keos::CShader::SetParameter(), Keos::CImage::SubImage(), Keos::CRectangle::Top(), and Keos::VectorDot().


The documentation for this class was generated from the following file:
Generated on Fri Mar 9 14:29:30 2007 for Keos by  doxygen 1.5.1-p1