2 #include "oxygine-include.h" 17 VectorT4(
const T&,
const T&,
const T&,
const T&);
33 inline T& operator[](
int i) {
return m[i];}
34 inline const T& operator[](
int i)
const {
return m[i];}
37 operator const T* ()
const;
42 template<
typename D>
friend D& operator << (D& os, VectorT4<T>* p);
43 template<
typename D>
friend D& operator << (D& os, VectorT4<T>& p);
63 VectorT4<T>::operator
const T* ()
const 69 VectorT3<T> VectorT4<T>::xyz()
const 71 return VectorT3<T>(x, y, z);
75 VectorT4<T>::VectorT4()
80 VectorT4<T>::VectorT4(
const T& X,
const T& Y,
const T& Z,
const T& W):
81 x(X), y(Y), z(Z), w(W)
86 VectorT4<T>::VectorT4(
const T* p): x(p[0]), y(p[1]), z(p[2]), w(p[3])
91 VectorT4<T>::VectorT4(
const VectorT3<T>& v,
const T& W):
92 x(v.x), y(v.y), z(v.z), w(W)
98 VectorT4<T>& VectorT4<T>::operator+=(
const VectorT4& v)
100 x += v.x; y += v.y; z += v.z; w += v.w;
return (*
this);
104 VectorT4<T>& VectorT4<T>::operator-=(
const VectorT4& v)
106 x -= v.x; y -= v.y; z -= v.z; w -= v.w;
return (*
this);
110 VectorT4<T> VectorT4<T>::operator + (
const VectorT4& v)
const 112 return VectorT4(x + v.x, y + v.y, z + v.z, w + v.w);
116 VectorT4<T> VectorT4<T>::operator - (
const VectorT4& v)
const 118 return VectorT4(x - v.x, y - v.y, z - v.z, w - v.w);
122 VectorT4<T>& VectorT4<T>::operator*=(T s)
124 x *= s; y *= s; z *= s; w *= s;
return (*
this);
128 VectorT4<T>& VectorT4<T>::operator/=(T s)
131 x *= is; y *= is; z *= is; w *= is;
return (*
this);
135 VectorT4<T> VectorT4<T>::operator * (T s)
const 137 return VectorT4(x * s, y * s, z * s, w * s);
141 VectorT4<T> VectorT4<T>::operator / (T v)
const 144 return VectorT4(x * s, y * s, z * s, w * s);
148 inline T VectorT4<T>::dot(
const VectorT4& v1,
const VectorT4& v2)
150 return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w;
154 inline VectorT4<T>* VectorT4<T>::planeFromPoints(VectorT4* pOut,
const vector3& v1,
const vector3& v2,
const vector3& v3)
157 vector3::normalFromPoints(&normal, v1, v2, v3);
158 T dist = normal.dot(v1);
160 *pOut = vector4(normal, dist);
165 typedef VectorT4<float> Vector4;
166 typedef VectorT4<double> VectorD4;
–oxgl-end–!
Definition: Actor.h:14