Changeset 682 for abuse/trunk/src/lol/matrix.h
 Timestamp:
 Sep 12, 2011, 10:17:23 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

abuse/trunk/src/lol/matrix.h
r660 r682 18 18 19 19 #include <cmath> 20 #if !defined __ANDROID__ 21 # include <iostream> 22 #endif 20 23 21 24 namespace lol … … 67 70 for (int n = 0; n < elems && n < dest; n++) \ 68 71 ret[n] = (*this)[n]; \ 72 for (int n = elems; n < dest; n++) \ 73 ret[n] = 0; \ 69 74 return ret; \ 70 75 } … … 138 143 OPERATORS(2) 139 144 145 #if !defined __ANDROID__ 146 template<typename U> 147 friend std::ostream &operator<<(std::ostream &stream, Vec2<U> const &v); 148 #endif 149 140 150 union { T x; T a; T i; }; 141 151 union { T y; T b; T j; }; … … 143 153 144 154 typedef Vec2<float> vec2; 145 typedef Vec2<int> vec2i;155 typedef Vec2<int> ivec2; 146 156 147 157 template <typename T> struct Vec3 … … 152 162 153 163 OPERATORS(3) 164 165 #if !defined __ANDROID__ 166 template<typename U> 167 friend std::ostream &operator<<(std::ostream &stream, Vec3<U> const &v); 168 #endif 154 169 155 170 union { T x; T a; T i; }; … … 159 174 160 175 typedef Vec3<float> vec3; 161 typedef Vec3<int> vec3i;176 typedef Vec3<int> ivec3; 162 177 163 178 template <typename T> struct Vec4 … … 168 183 169 184 OPERATORS(4) 185 186 #if !defined __ANDROID__ 187 template<typename U> 188 friend std::ostream &operator<<(std::ostream &stream, Vec4<U> const &v); 189 #endif 170 190 171 191 union { T x; T a; T i; }; … … 176 196 177 197 typedef Vec4<float> vec4; 178 typedef Vec4<int> vec4i;198 typedef Vec4<int> ivec4; 179 199 180 200 #define SCALAR_GLOBAL(elems, op, U) \ … … 230 250 231 251 void printf() const; 252 253 #if !defined __ANDROID__ 254 template<class U> 255 friend std::ostream &operator<<(std::ostream &stream, Mat4<U> const &m); 256 #endif 232 257 233 258 inline Mat4<T> operator +(Mat4<T> const val) const … … 295 320 296 321 typedef Mat4<float> mat4; 297 typedef Mat4<int> mat4i;322 typedef Mat4<int> imat4; 298 323 299 324 } /* namespace lol */
Note: See TracChangeset
for help on using the changeset viewer.