Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CVector3< T > Class Template Reference

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

`#include <KeosVector3.h>`

List of all members.

## Public Member Functions

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

## Public Attributes

T | x
T | y
T | z

## Detailed Description

### template<class T>
class Keos::CVector3< T >

Standard 3-dimensional vector with customizable type.

Definition at line 34 of file KeosVector3.h.

## Constructor & Destructor Documentation

template<class T>
Keos::CVector3< T >::CVector3 | ( | T | X = `0`,
|  | T | Y = `0`,
|  | T | Z = `0`
| ) | `[inline]`

| Default constructor. Definition at line 103 of file KeosVector3.h.

## Member Function Documentation

template<class T>
T Keos::CVector3< T >::Length | ( |  | ) | const`[inline]`

| Returns the length (magnitude) of the vector (sqrt(x² + y²)). Definition at line 122 of file KeosVector3.h. References Keos::CVector3< T >::LengthSq(). Referenced by Keos::CVector3< T >::Normalize().

template<class T>
T Keos::CVector3< T >::LengthSq | ( |  | ) | const`[inline]`

| Returns the square of the length(magnitude) of the vector (x² + y²). Definition at line 129 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z. Referenced by Keos::CVector3< T >::Length().

template<class T>
void Keos::CVector3< T >::Normalize | ( |  | ) | `[inline]`

| Normalizes the vector. Definition at line 136 of file KeosVector3.h. References Keos::CVector3< T >::Length(), Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z. Referenced by Keos::CMatrix4::LookAt().

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

| Definition at line 200 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

template<class T>
Keos::CVector3< T >::operator T * | ( |  | ) | `[inline]`

| T* cast operator.

Returns:
  Pointer on the vector components.

Definition at line 238 of file KeosVector3.h.

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

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

| Definition at line 231 of file KeosVector3.h.

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

| Definition at line 164 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

template<class T>
CVector3< T > Keos::CVector3< T >::operator+ | ( |  | ) | const`[inline]`

| Definition at line 150 of file KeosVector3.h.

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

| Definition at line 178 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

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

| Definition at line 171 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

template<class T>
CVector3< T > Keos::CVector3< T >::operator- | ( |  | ) | const`[inline]`

| Definition at line 157 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

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

| Definition at line 189 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

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

| Definition at line 211 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

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

| Definition at line 222 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

template<class T>
void Keos::CVector3< T >::Set | ( | T | X,
|  | T | Y,
|  | T | Z
| ) | `[inline]`

| Set vector. Definition at line 113 of file KeosVector3.h. References Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z. Referenced by Keos::CFontManager::DrawString().

## Member Data Documentation

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

| Definition at line 80 of file KeosVector3.h. Referenced by Keos::CVector3< T >::LengthSq(), Keos::CMDLQ1Loader::LoadFromFile(), Keos::CMD2Loader::LoadFromFile(), Keos::CMatrix4::LookAt(), Keos::CVector3< T >::Normalize(), Keos::CVector3< T >::operator *=(), Keos::CVector3< T >::operator T *(), Keos::CVector3< T >::operator+(), Keos::CVector3< T >::operator+=(), Keos::CVector3< T >::operator-(), Keos::CVector3< T >::operator-=(), Keos::CVector3< T >::operator/=(), Keos::CVector3< T >::operator==(), and Keos::CVector3< T >::Set().

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

| Definition at line 80 of file KeosVector3.h. Referenced by Keos::CVector3< T >::LengthSq(), Keos::CMDLQ1Loader::LoadFromFile(), Keos::CMD2Loader::LoadFromFile(), Keos::CMatrix4::LookAt(), Keos::CVector3< T >::Normalize(), Keos::CVector3< T >::operator *=(), Keos::CVector3< T >::operator+(), Keos::CVector3< T >::operator+=(), Keos::CVector3< T >::operator-(), Keos::CVector3< T >::operator-=(), Keos::CVector3< T >::operator/=(), Keos::CVector3< T >::operator==(), and Keos::CVector3< T >::Set().

template<class T>
T Keos::CVector3< T >::z

| Definition at line 80 of file KeosVector3.h. Referenced by Keos::CVector3< T >::LengthSq(), Keos::CMDLQ1Loader::LoadFromFile(), Keos::CMD2Loader::LoadFromFile(), Keos::CMatrix4::LookAt(), Keos::CVector3< T >::Normalize(), Keos::CVector3< T >::operator *=(), Keos::CVector3< T >::operator+(), Keos::CVector3< T >::operator+=(), Keos::CVector3< T >::operator-(), Keos::CVector3< T >::operator-=(), Keos::CVector3< T >::operator/=(), Keos::CVector3< T >::operator==(), and Keos::CVector3< T >::Set().

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

- KeosEngine/KeosVector3.h