Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Teddy::Maths::TVector Class Template Reference

Template Class TVector. More...

#include <Vector.h>

Inheritance diagram for Teddy::Maths::TVector:

Inheritance graph
[legend]
Collaboration diagram for Teddy::Maths::TVector:

Collaboration graph
[legend]
List of all members.

Public Methods

 TVector ()
 TVector (const int a, const int b, const int c)
 TVector (const float a, const float b, const float c)
 TVector (const double a, const double b, const double c)
 TVector (const T t)
 TVector (const T *pt)
 TVector (const TVector< double > &v)
 TVector (const TVector< float > &v)
 TVector (const TVector< int > &v)
 TVector (const Quaternion &q)
 operator T * ()
T & operator[] (const int n)
 operator const T * () const
operator[] (const int n) const
TVector< T > operator- () const
void operator= (const T t)
void operator= (const T *pt)
void operator= (const TVector< T > &vec)
bool operator== (const TVector< T > &vec) const
bool operator!= (const TVector< T > &vec) const
int getMaxIndex () const
TVector< T > operator+ (const T t) const
TVector< T > operator- (const T t) const
TVector< T > operator * (const T t) const
TVector< T > operator/ (const T t) const
const TVector< T > & operator+= (const T t)
const TVector< T > & operator-= (const T t)
const TVector< T > & operator *= (const T t)
const TVector< T > & operator/= (const T t)
TVector< T > operator+ (const TVector< T > &vec) const
TVector< T > operator- (const TVector< T > &vec) const
TVector< T > operator * (const TVector< T > &vec) const
TVector< T > operator/ (const TVector< T > &vec) const
const TVector< T > & operator+= (const TVector< T > &vec)
const TVector< T > & operator-= (const TVector< T > &vec)
const TVector< T > & operator *= (const TVector< T > &vec)
const TVector< T > & operator/= (const TVector< T > &vec)
operator| (const TVector< T > &vec) const
TVector< T > operator^ (const TVector< T > &vec) const
const TVector< T > & operator^= (const TVector< T > &vec)
magnitudeSquared () const
magnitude () const
distanceSquared (const TVector< T > &vec) const
distance (const TVector< T > &vec) const
TVector< T > midpoint (const TVector< T > &vec) const
TVector< T > average (const TVector< T > &vec) const
void normalize ()
double angle (const TVector< T > &vec) const
TVector< T > reflect (const TVector< T > &n) const
TVector< T > rotate (const T tAngle, const Vector &n) const

Public Attributes

v [3]

Detailed Description

template<typename T>
class Teddy::Maths::TVector< T >

Template Class TVector.

Author:
Sean O'Neil
This template class implements a simple 3D vector with v[0], v[1], and v[2] coordinates. Several functions and operators are defined to make working with vectors easier, and because it's templatized, any numeric type can be used with it. Macros are defined for the most common types.

Definition at line 74 of file Vector.h.


Constructor & Destructor Documentation

template<typename T>
Teddy::Maths::TVector< T >::TVector   [inline]
 

Definition at line 79 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const int    a,
const int    b,
const int    c
[inline]
 

Definition at line 85 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const float    a,
const float    b,
const float    c
[inline]
 

Definition at line 90 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const double    a,
const double    b,
const double    c
[inline]
 

Definition at line 95 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const T    t [inline]
 

Definition at line 101 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const T *    pt [inline]
 

Definition at line 102 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const TVector< double > &    v [inline]
 

Definition at line 103 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const TVector< float > &    v [inline]
 

Definition at line 104 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const TVector< int > &    v [inline]
 

Definition at line 105 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::TVector const Quaternion   q [inline]
 

Definition at line 107 of file Vector.h.


Member Function Documentation

template<typename T>
double Teddy::Maths::TVector< T >::angle const TVector< T > &    vec const [inline]
 

Definition at line 173 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::average const TVector< T > &    vec const [inline]
 

Definition at line 169 of file Vector.h.

template<typename T>
T Teddy::Maths::TVector< T >::distance const TVector< T > &    vec const [inline]
 

Definition at line 167 of file Vector.h.

template<typename T>
T Teddy::Maths::TVector< T >::distanceSquared const TVector< T > &    vec const [inline]
 

Definition at line 166 of file Vector.h.

template<typename T>
int Teddy::Maths::TVector< T >::getMaxIndex   const [inline]
 

Definition at line 125 of file Vector.h.

template<typename T>
T Teddy::Maths::TVector< T >::magnitude   const [inline]
 

Definition at line 165 of file Vector.h.

Referenced by Teddy::Maths::TVector< float >::normalize, and Teddy::Maths::TVector< float >::reflect.

template<typename T>
T Teddy::Maths::TVector< T >::magnitudeSquared   const [inline]
 

Definition at line 164 of file Vector.h.

Referenced by Teddy::Maths::TVector< float >::magnitude.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::midpoint const TVector< T > &    vec const [inline]
 

Definition at line 168 of file Vector.h.

template<typename T>
void Teddy::Maths::TVector< T >::normalize   [inline]
 

Definition at line 172 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator * const TVector< T > &    vec const [inline]
 

Definition at line 151 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator * const T    t const [inline]
 

Definition at line 141 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator *= const TVector< T > &    vec [inline]
 

Definition at line 155 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator *= const T    t [inline]
 

Definition at line 145 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::operator const T *   const [inline]
 

Definition at line 114 of file Vector.h.

template<typename T>
Teddy::Maths::TVector< T >::operator T *   [inline]
 

Definition at line 112 of file Vector.h.

template<typename T>
bool Teddy::Maths::TVector< T >::operator!= const TVector< T > &    vec const [inline]
 

Definition at line 123 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator+ const TVector< T > &    vec const [inline]
 

Definition at line 149 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator+ const T    t const [inline]
 

Definition at line 139 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator+= const TVector< T > &    vec [inline]
 

Definition at line 153 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator+= const T    t [inline]
 

Definition at line 143 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator- const TVector< T > &    vec const [inline]
 

Definition at line 150 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator- const T    t const [inline]
 

Definition at line 140 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator-   const [inline]
 

Definition at line 116 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator-= const TVector< T > &    vec [inline]
 

Definition at line 154 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator-= const T    t [inline]
 

Definition at line 144 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator/ const TVector< T > &    vec const [inline]
 

Definition at line 152 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator/ const T    t const [inline]
 

Definition at line 142 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator/= const TVector< T > &    vec [inline]
 

Definition at line 156 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator/= const T    t [inline]
 

Definition at line 146 of file Vector.h.

template<typename T>
void Teddy::Maths::TVector< T >::operator= const TVector< T > &    vec [inline]
 

Definition at line 121 of file Vector.h.

template<typename T>
void Teddy::Maths::TVector< T >::operator= const T *    pt [inline]
 

Definition at line 120 of file Vector.h.

template<typename T>
void Teddy::Maths::TVector< T >::operator= const T    t [inline]
 

Definition at line 119 of file Vector.h.

template<typename T>
bool Teddy::Maths::TVector< T >::operator== const TVector< T > &    vec const [inline]
 

Definition at line 122 of file Vector.h.

template<typename T>
T Teddy::Maths::TVector< T >::operator[] const int    n const [inline]
 

Definition at line 115 of file Vector.h.

template<typename T>
T& Teddy::Maths::TVector< T >::operator[] const int    n [inline]
 

Definition at line 113 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::operator^ const TVector< T > &    vec const [inline]
 

Definition at line 160 of file Vector.h.

template<typename T>
const TVector<T>& Teddy::Maths::TVector< T >::operator^= const TVector< T > &    vec [inline]
 

Definition at line 161 of file Vector.h.

template<typename T>
T Teddy::Maths::TVector< T >::operator| const TVector< T > &    vec const [inline]
 

Definition at line 159 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::reflect const TVector< T > &    n const [inline]
 

Definition at line 174 of file Vector.h.

template<typename T>
TVector<T> Teddy::Maths::TVector< T >::rotate const T    tAngle,
const Vector &    n
const [inline]
 

Definition at line 180 of file Vector.h.


Member Data Documentation

template<typename T>
T Teddy::Maths::TVector::v[3]
 

Definition at line 76 of file Vector.h.

Referenced by Teddy::Maths::TVector< float >::getMaxIndex, Teddy::Maths::TVector< float >::magnitudeSquared, Teddy::Maths::TVector< float >::midpoint, Teddy::Maths::TVector< float >::operator *, Teddy::Maths::TVector< float >::operator *=, Teddy::Maths::TVector< float >::operator const T *, Teddy::Maths::TVector< float >::operator T *, Teddy::Maths::TVector< float >::operator+, Teddy::Maths::TVector< float >::operator+=, Teddy::Maths::TVector< float >::operator-, Teddy::Maths::TVector< float >::operator-=, Teddy::Maths::TVector< float >::operator/, Teddy::Maths::TVector< float >::operator/=, Teddy::Maths::TVector< float >::operator=, Teddy::Maths::TVector< float >::operator==, Teddy::Maths::TVector< float >::operator[], Teddy::Maths::TVector< float >::operator^, Teddy::Maths::TVector< float >::operator|, Teddy::Maths::TVector< float >::reflect, and Teddy::Maths::TVector< float >::TVector.


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