Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Audio::TVector3< T > Class Template Reference

#include <Vector.h>

Public Member Functions

 TVector3 ()
 
 TVector3 (T xx, T yy, T zz)
 
 TVector3 (T s)
 
template<typename Y >
 TVector3 (const TVector3< Y > &other)
 
template<typename Y >
TVector3< T > & operator= (const TVector3< Y > &other)
 
TVector3< T > & operator+= (const TVector3< T > &other)
 
TVector3< T > & operator-= (const TVector3< T > &other)
 
TVector3< T > & operator*= (const TVector3< T > &other)
 
TVector3< T > & operator*= (T t)
 
TVector3< T > & operator/= (const TVector3< T > &other)
 
TVector3< T > & operator/= (T t)
 
TVector3< T > operator+ (const TVector3< T > &other) const
 
TVector3< T > operator- (const TVector3< T > &other) const
 
TVector3< T > operator- () const
 
TVector3< T > operator* (const TVector3< T > &other) const
 
TVector3< T > operator/ (const TVector3< T > &other) const
 
TVector3< T > operator* (T t) const
 
TVector3< T > operator/ (T t) const
 
dot (TVector3< T > other) const
 
normSquared () const
 
norm () const
 
lengthSquared () const
 
length () const
 
distanceSquared (const TVector3< T > &other) const
 
distance (const TVector3< T > &other) const
 
TVector3< T > cross (const TVector3< T > &v) const
 
void normalize ()
 
TVector3< T > normalized () const
 

Public Attributes

x
 
y
 
z
 

Detailed Description

template<typename T>
class Audio::TVector3< T >

Definition at line 11 of file Vector.h.

Constructor & Destructor Documentation

template<typename T>
Audio::TVector3< T >::TVector3 ( )
inline

Definition at line 15 of file Vector.h.

15 {}
template<typename T>
Audio::TVector3< T >::TVector3 ( xx,
yy,
zz 
)
inline

Definition at line 16 of file Vector.h.

16 : x(xx), y(yy), z(zz) {}
template<typename T>
Audio::TVector3< T >::TVector3 ( s)
inlineexplicit

Definition at line 17 of file Vector.h.

17 : x(s), y(s), z(s) {}
template<typename T>
template<typename Y >
Audio::TVector3< T >::TVector3 ( const TVector3< Y > &  other)
inline

Definition at line 20 of file Vector.h.

20 : x(T(other.x)), y(T(other.y)), z(T(other.z)) {}

Member Function Documentation

template<typename T>
TVector3<T> Audio::TVector3< T >::cross ( const TVector3< T > &  v) const
inline

Definition at line 149 of file Vector.h.

150  {
151  return TVector3<T>(
152  y * v.z - z * v.y,
153  z * v.x - x * v.z,
154  x * v.y - y * v.x
155  );
156  }
template<typename T>
T Audio::TVector3< T >::distance ( const TVector3< T > &  other) const
inline

Definition at line 144 of file Vector.h.

145  {
146  return sqrt(distanceSquared(other));
147  }
template<typename T>
T Audio::TVector3< T >::distanceSquared ( const TVector3< T > &  other) const
inline

Definition at line 139 of file Vector.h.

Referenced by Audio::SceneManager::activationPhaseImpl(), and Audio::TVector3< LScalar >::distance().

140  {
141  return (other - *this).normSquared();
142  }
template<typename T>
T Audio::TVector3< T >::dot ( TVector3< T >  other) const
inline

Definition at line 114 of file Vector.h.

Referenced by Audio::TVector3< LScalar >::normSquared().

115  {
116  return x*other.x + y*other.y + z*other.z;
117  }
template<typename T>
T Audio::TVector3< T >::length ( ) const
inline

Definition at line 134 of file Vector.h.

135  {
136  return norm();
137  }
template<typename T>
T Audio::TVector3< T >::lengthSquared ( ) const
inline

Definition at line 129 of file Vector.h.

130  {
131  return normSquared();
132  }
template<typename T>
T Audio::TVector3< T >::norm ( ) const
inline
template<typename T>
void Audio::TVector3< T >::normalize ( )
inline

Definition at line 158 of file Vector.h.

159  {
160  *this /= norm();
161  }
template<typename T>
TVector3<T> Audio::TVector3< T >::normalized ( ) const
inline

Definition at line 163 of file Vector.h.

164  {
165  return *this / norm();
166  }
template<typename T>
T Audio::TVector3< T >::normSquared ( ) const
inline

Definition at line 119 of file Vector.h.

Referenced by Audio::TVector3< LScalar >::lengthSquared(), and Audio::TVector3< LScalar >::norm().

120  {
121  return dot(*this);
122  }
template<typename T>
TVector3<T> Audio::TVector3< T >::operator* ( const TVector3< T > &  other) const
inline

Definition at line 94 of file Vector.h.

95  {
96  return TVector3<T>(x*other.x, y*other.y, z*other.z);
97  }
template<typename T>
TVector3<T> Audio::TVector3< T >::operator* ( t) const
inline

Definition at line 104 of file Vector.h.

105  {
106  return TVector3<T>(x*t, y*t, z*t);
107  }
template<typename T>
TVector3<T>& Audio::TVector3< T >::operator*= ( const TVector3< T > &  other)
inline

Definition at line 47 of file Vector.h.

48  {
49  x *= other.x;
50  y *= other.y;
51  z *= other.z;
52  return *this;
53  }
template<typename T>
TVector3<T>& Audio::TVector3< T >::operator*= ( t)
inline

Definition at line 55 of file Vector.h.

56  {
57  x *= t;
58  y *= t;
59  z *= t;
60  return *this;
61  }
template<typename T>
TVector3<T> Audio::TVector3< T >::operator+ ( const TVector3< T > &  other) const
inline

Definition at line 79 of file Vector.h.

80  {
81  return TVector3<T>(x+other.x, y+other.y, z+other.z);
82  }
template<typename T>
TVector3<T>& Audio::TVector3< T >::operator+= ( const TVector3< T > &  other)
inline

Definition at line 31 of file Vector.h.

32  {
33  x += other.x;
34  y += other.y;
35  z += other.z;
36  return *this;
37  }
template<typename T>
TVector3<T> Audio::TVector3< T >::operator- ( const TVector3< T > &  other) const
inline

Definition at line 84 of file Vector.h.

85  {
86  return TVector3<T>(x-other.x, y-other.y, z-other.z);
87  }
template<typename T>
TVector3<T> Audio::TVector3< T >::operator- ( ) const
inline

Definition at line 89 of file Vector.h.

90  {
91  return TVector3<T>(-x, -y, -z);
92  }
template<typename T>
TVector3<T>& Audio::TVector3< T >::operator-= ( const TVector3< T > &  other)
inline

Definition at line 39 of file Vector.h.

40  {
41  x -= other.x;
42  y -= other.y;
43  z -= other.z;
44  return *this;
45  }
template<typename T>
TVector3<T> Audio::TVector3< T >::operator/ ( const TVector3< T > &  other) const
inline

Definition at line 99 of file Vector.h.

100  {
101  return TVector3<T>(x/other.x, y/other.y, z/other.z);
102  }
template<typename T>
TVector3<T> Audio::TVector3< T >::operator/ ( t) const
inline

Definition at line 109 of file Vector.h.

110  {
111  return TVector3<T>(x/t, y/t, z/t);
112  }
template<typename T>
TVector3<T>& Audio::TVector3< T >::operator/= ( const TVector3< T > &  other)
inline

Definition at line 63 of file Vector.h.

64  {
65  x /= other.x;
66  y /= other.y;
67  z /= other.z;
68  return *this;
69  }
template<typename T>
TVector3<T>& Audio::TVector3< T >::operator/= ( t)
inline

Definition at line 71 of file Vector.h.

72  {
73  x /= t;
74  y /= t;
75  z /= t;
76  return *this;
77  }
template<typename T>
template<typename Y >
TVector3<T>& Audio::TVector3< T >::operator= ( const TVector3< Y > &  other)
inline

Definition at line 23 of file Vector.h.

24  {
25  x = T(other.x);
26  y = T(other.y);
27  z = T(other.z);
28  return *this;
29  }

Member Data Documentation


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