36 #include "../api_core.h"
43 template<
typename Type>
46 template<
typename Type>
49 template<
typename Type>
52 template<
typename Type>
55 template<
typename Type>
58 template<
typename Type>
61 template<
typename Type>
64 template<
typename Type>
67 template<
typename Type>
78 template<
typename Type>
84 union { Type
x; Type
s; Type
r; };
85 union { Type
y; Type
t; Type
g; };
91 CL_Vec2(
const Type &p1,
const Type &p2 = 0) :
x(p1),
y(p2) { }
92 CL_Vec2(
const Type *array_xy) :
x(array_xy[0]),
y(array_xy[1]) { }
216 const Type &
operator[](
unsigned int i)
const {
return ((Type *)
this)[i]; }
217 Type &
operator[](
unsigned int i) {
return ((Type *)
this)[i]; }
218 operator Type *() {
return (Type *)
this; }
219 operator Type *
const()
const {
return (Type *
const)
this; }
283 template<
typename Type>
287 matrix[0*2+0]*v.
x + matrix[0*2+1]*v.
y,
288 matrix[1*2+0]*v.
x + matrix[1*2+1]*v.
y);
291 template<
typename Type>
295 matrix[0*2+0]*v.
x + matrix[1*2+0]*v.
y,
296 matrix[0*2+1]*v.
x + matrix[1*2+1]*v.
y);