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

# Keos::CVector4< T > Class Template Reference

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

`#include <KeosVector4.h>`

List of all members.

## Public Member Functions

| CVector4 (T X=0, T Y=0, T Z=0, T W=1)
| Default constructor.
void | Set (T X, T Y, T Z, T W)
| 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.
CVector4< T > | operator+ () const
CVector4< T > | operator- () const
CVector4< T > | operator+ (const CVector4< T > &v) const
CVector4< T > | operator- (const CVector4< T > &v) const
const CVector4< T > & | operator+= (const CVector4< T > &v)
const CVector4< T > & | operator-= (const CVector4< T > &v)
CVector4< T > | operator * (T t) const
CVector4< T > | operator/ (T t) const
const CVector4< T > & | operator *= (T t)
const CVector4< T > & | operator/= (T t)
bool | operator== (const CVector4< T > &v) const
bool | operator!= (const CVector4< T > &v) const
| operator T * ()
| T* cast operator.

## Public Attributes

T | x
T | y
T | z
T | w

## Detailed Description

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

Standard 4-dimensional vector with customizable type.

Definition at line 34 of file KeosVector4.h.

## Constructor & Destructor Documentation

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

| Default constructor. Definition at line 105 of file KeosVector4.h.

## Member Function Documentation

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

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

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

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

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

| Normalizes the vector. Definition at line 140 of file KeosVector4.h. References Keos::CVector4< T >::Length(), Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 207 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 221 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| T* cast operator.

Returns:
  Pointer on the vector components.

Definition at line 262 of file KeosVector4.h.

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

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

| Definition at line 255 of file KeosVector4.h.

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

| Definition at line 169 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 155 of file KeosVector4.h.

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

| Definition at line 183 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 176 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 162 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 195 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 214 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 233 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Definition at line 245 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

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

| Set vector. Definition at line 116 of file KeosVector4.h. References Keos::CVector4< T >::w, Keos::CVector4< T >::x, Keos::CVector4< T >::y, and Keos::CVector4< T >::z.

## Member Data Documentation

template<class T>
T Keos::CVector4< T >::w

| Definition at line 83 of file KeosVector4.h. Referenced by Keos::CVector4< T >::LengthSq(), Keos::CVector4< T >::Normalize(), Keos::CVector4< T >::operator *(), Keos::CVector4< T >::operator *=(), Keos::CVector4< T >::operator+(), Keos::CVector4< T >::operator+=(), Keos::CVector4< T >::operator-(), Keos::CVector4< T >::operator-=(), Keos::CVector4< T >::operator/(), Keos::CVector4< T >::operator/=(), Keos::CVector4< T >::operator==(), and Keos::CVector4< T >::Set().

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

| Definition at line 83 of file KeosVector4.h. Referenced by Keos::CVector4< T >::LengthSq(), Keos::CVector4< T >::Normalize(), Keos::CVector4< T >::operator *(), Keos::CVector4< T >::operator *=(), Keos::CVector4< T >::operator T *(), Keos::CVector4< T >::operator+(), Keos::CVector4< T >::operator+=(), Keos::CVector4< T >::operator-(), Keos::CVector4< T >::operator-=(), Keos::CVector4< T >::operator/(), Keos::CVector4< T >::operator/=(), Keos::CVector4< T >::operator==(), and Keos::CVector4< T >::Set().

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

| Definition at line 83 of file KeosVector4.h. Referenced by Keos::CVector4< T >::LengthSq(), Keos::CVector4< T >::Normalize(), Keos::CVector4< T >::operator *(), Keos::CVector4< T >::operator *=(), Keos::CVector4< T >::operator+(), Keos::CVector4< T >::operator+=(), Keos::CVector4< T >::operator-(), Keos::CVector4< T >::operator-=(), Keos::CVector4< T >::operator/(), Keos::CVector4< T >::operator/=(), Keos::CVector4< T >::operator==(), and Keos::CVector4< T >::Set().

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

| Definition at line 83 of file KeosVector4.h. Referenced by Keos::CVector4< T >::LengthSq(), Keos::CVector4< T >::Normalize(), Keos::CVector4< T >::operator *(), Keos::CVector4< T >::operator *=(), Keos::CVector4< T >::operator+(), Keos::CVector4< T >::operator+=(), Keos::CVector4< T >::operator-(), Keos::CVector4< T >::operator-=(), Keos::CVector4< T >::operator/(), Keos::CVector4< T >::operator/=(), Keos::CVector4< T >::operator==(), and Keos::CVector4< T >::Set().

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

- KeosEngine/KeosVector4.h