12
inline Vec4<T>(const T&, const T&, const T&, const T&);
14
inline Vec4(const Vec4<T>&);
16
inline Vec4<T>& operator = (const Vec4<T>&);
17
inline t_bool operator == (const Vec4<T>&) const;
18
inline t_bool operator != (const Vec4<T>&) const;
19
inline Vec4<T> operator + (const Vec4<T>&) const;
20
inline Vec4<T> operator * (const Vec4<T>&) const;
21
inline Vec4<T> operator - (const Vec4<T>&) const;
22
inline Vec4<T> operator - () const;
24
inline Vec4<T>& operator *= (const Vec4<T>&);
25
inline Vec4<T>& operator += (const Vec4<T>&);
26
inline Vec4<T>& operator -= (const Vec4<T>&);
28
inline Vec4<T> operator / (const T&) const;
29
inline Vec4<T> operator * (const T&) const;
30
inline Vec4<T>& operator /= (const T&);
31
inline Vec4<T>& operator *= (const T&);
33
inline T& operator [](int i);
34
inline const T& operator [](int i) const;
36
void divide_xyz_by_w();
38
template <typename U> friend Vec4<U> operator* (const U&, const Vec4<U>&);
45
inline Vec4<T>::Vec4()
54
inline Vec4<T>::~Vec4()
60
inline Vec4<T>::Vec4(const T& fx, const T& fy, const T& fz, const T& fw)
68
//Vec4::Vec4(t_double fx, t_double fy, t_double fz, t_double fw)
76
//Vec4::Vec4(t_int fx, t_int fy, t_int fz, t_int fw)
85
inline Vec4<T>::Vec4(const Vec4<T>& v)
94
inline Vec4<T>& Vec4<T>::operator= (const Vec4<T>& v)
103
template <typename T>
104
inline t_bool Vec4<T>::operator == (const Vec4<T>& v) const
116
template <typename T>
117
inline t_bool Vec4<T>::operator != (const Vec4<T>& v) const
119
return !(*this == v);
122
template <typename T>
123
inline Vec4<T> Vec4<T>::operator+ (const Vec4<T>& v) const
125
return Vec4(x + v.x, y + v.y, z + v.z, w + v.w);
128
template <typename T>
129
inline Vec4<T> Vec4<T>::operator* (const Vec4<T>& v) const
131
return Vec4<T>(x * v.x, y * v.y, z * v.z, w * v.w);
134
template <typename T>
135
inline Vec4<T> Vec4<T>::operator- (const Vec4<T>& v) const
137
return Vec4<T>(x - v.x, y - v.y, z - v.z, w - v.w);
140
template <typename T>
141
inline Vec4<T> Vec4<T>::operator- () const
143
//Do that for Matices too
144
return Vec4<T>(-x, -y, -z, -w);
147
template <typename T>
148
inline Vec4<T>& Vec4<T>::operator*= (const Vec4<T>& v)
157
template <typename T>
158
inline Vec4<T>& Vec4<T>::operator+= (const Vec4<T>& v)
167
template <typename T>
168
inline Vec4<T>& Vec4<T>::operator-= (const Vec4<T>& v)
177
template <typename T>
178
inline Vec4<T> Vec4<T>::operator / (const T& f) const
182
throw DivisionByZeroException();
184
return Vec4(x / f, y / f, z / f, w / f);
187
template <typename T>
188
inline Vec4<T> Vec4<T>::operator * (const T& f) const
190
return Vec4<T>(x * f, y * f, z * f, w * f);
193
template <typename T>
194
inline Vec4<T>& Vec4<T>::operator /= (const T& f)
198
throw DivisionByZeroException();
207
template <typename T>
208
inline Vec4<T>& Vec4<T>::operator *= (const T& f)
217
template <typename T>
218
inline Vec4<T> operator* (T f , const Vec4<T>& v)
220
return Vec4<T>(f * v.x, f * v.y, f * v.z, f * v.w);
223
template <typename T>
224
inline T& Vec4<T>::operator [](int i)
231
/// element access (const)
232
template <typename T>
233
inline const T& Vec4<T>::operator [](int i) const
240
template <typename T>
241
void Vec4<T>::divide_xyz_by_w()
245
throw DivisionByZeroException();
252
template <typename U>
253
Vec4<U> operator* (const U& f, const Vec4<U>& v)
258
typedef Vec4<float> Vector4;