Go to the documentation of this file.
36 #include "../api_core.h"
42 template<
typename Type>
45 template<
typename Type>
48 template<
typename Type>
51 template<
typename Type>
54 template<
typename Type>
57 template<
typename Type>
60 template<
typename Type>
63 template<
typename Type>
66 template<
typename Type>
77 template<
typename Type>
83 union { Type
x; Type
s; Type
r; };
84 union { Type
y; Type
t; Type
g; };
85 union { Type
z; Type
u; Type
b; };
86 union { Type
w; Type
v; Type
a; };
92 CL_Vec4(
const Type &p1,
const Type &p2 = 0,
const Type &p3 = 0,
const Type &p4 = 0) :
x(p1),
y(p2),
z(p3),
w(p4) { }
93 CL_Vec4(
const Type *array_xyzw) :
x(array_xyzw[0]),
y(array_xyzw[1]),
z(array_xyzw[2]),
w(array_xyzw[3]) { }
250 const Type &
operator[](
unsigned int i)
const {
return ((Type *)
this)[i]; }
251 Type &
operator[](
unsigned int i) {
return ((Type *)
this)[i]; }
252 operator Type *() {
return (Type *)
this; }
253 operator Type *
const()
const {
return (Type *
const)
this; }
314 template<
typename Type>
318 matrix[0*4+0]*v.
x + matrix[0*4+1]*v.
y + matrix[0*4+2]*v.
z + matrix[0*4+3]*v.
w,
319 matrix[1*4+0]*v.
x + matrix[1*4+1]*v.
y + matrix[1*4+2]*v.
z + matrix[1*4+3]*v.
w,
320 matrix[2*4+0]*v.
x + matrix[2*4+1]*v.
y + matrix[2*4+2]*v.
z + matrix[2*4+3]*v.
w,
321 matrix[3*4+0]*v.
x + matrix[3*4+1]*v.
y + matrix[3*4+2]*v.
z + matrix[3*4+3]*v.
w);
324 template<
typename Type>
328 matrix[0*4+0]*v.
x + matrix[1*4+0]*v.
y + matrix[2*4+0]*v.
z + matrix[3*4+0]*v.
w,
329 matrix[0*4+1]*v.
x + matrix[1*4+1]*v.
y + matrix[2*4+1]*v.
z + matrix[3*4+1]*v.
w,
330 matrix[0*4+2]*v.
x + matrix[1*4+2]*v.
y + matrix[2*4+2]*v.
z + matrix[3*4+2]*v.
w,
331 matrix[0*4+3]*v.
x + matrix[1*4+3]*v.
y + matrix[2*4+3]*v.
z + matrix[3*4+3]*v.
w);