Changeset 1041 for trunk/src/matrix.h
 Timestamp:
 Oct 31, 2011, 9:19:09 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/matrix.h
r1035 r1041 114 114 using namespace std; \ 115 115 return sqrtf((float)sqlen()); \ 116 } 116 } \ 117 \ 118 template<typename U> \ 119 friend U dot(Vec##elems<U>, Vec##elems<U>); \ 120 template<typename U> \ 121 friend Vec##elems<U> normalize(Vec##elems<U>); \ 122 \ 123 void printf() const; 117 124 118 125 #define SWIZZLE2(e1, e2) \ … … 206 213 }; 207 214 215 typedef Vec2<half> f16vec2; 208 216 typedef Vec2<float> vec2; 209 typedef Vec2<int> ivec2; 217 typedef Vec2<int8_t> i8vec2; 218 typedef Vec2<uint8_t> u8vec2; 219 typedef Vec2<int16_t> i16vec2; 220 typedef Vec2<uint16_t> u16vec2; 221 typedef Vec2<int32_t> ivec2; 222 typedef Vec2<uint32_t> uvec2; 223 typedef Vec2<int64_t> i64vec2; 224 typedef Vec2<uint64_t> u64vec2; 210 225 211 226 /* … … 227 242 SWIZZLE4333(x); SWIZZLE4333(y); SWIZZLE4333(z); 228 243 244 template<typename U> 245 friend Vec3<U> cross(Vec3<U>, Vec3<U>); 246 229 247 #if !defined __ANDROID__ 230 248 template<typename U> … … 237 255 }; 238 256 257 typedef Vec3<half> f16vec3; 239 258 typedef Vec3<float> vec3; 240 typedef Vec3<int> ivec3; 259 typedef Vec3<int8_t> i8vec3; 260 typedef Vec3<uint8_t> u8vec3; 261 typedef Vec3<int16_t> i16vec3; 262 typedef Vec3<uint16_t> u16vec3; 263 typedef Vec3<int32_t> ivec3; 264 typedef Vec3<uint32_t> uvec3; 265 typedef Vec3<int64_t> i64vec3; 266 typedef Vec3<uint64_t> u64vec3; 241 267 242 268 /* … … 273 299 }; 274 300 301 typedef Vec4<half> f16vec4; 275 302 typedef Vec4<float> vec4; 276 typedef Vec4<int> ivec4; 303 typedef Vec4<int8_t> i8vec4; 304 typedef Vec4<uint8_t> u8vec4; 305 typedef Vec4<int16_t> i16vec4; 306 typedef Vec4<uint16_t> u16vec4; 307 typedef Vec4<int32_t> ivec4; 308 typedef Vec4<uint32_t> uvec4; 309 typedef Vec4<int64_t> i64vec4; 310 typedef Vec4<uint64_t> u64vec4; 277 311 278 312 #define SCALAR_GLOBAL(elems, op, U) \ … … 327 361 static Mat4<T> ortho(T left, T right, T bottom, T top, T near, T far); 328 362 static Mat4<T> frustum(T left, T right, T bottom, T top, T near, T far); 363 static Mat4<T> lookat(Vec3<T> eye, Vec3<T> center, Vec3<T> up); 329 364 static Mat4<T> perspective(T theta, T width, T height, T near, T far); 330 365 static Mat4<T> translate(T x, T y, T z); 366 static Mat4<T> translate(Vec3<T> v); 331 367 static Mat4<T> rotate(T theta, T x, T y, T z); 368 static Mat4<T> rotate(T theta, Vec3<T> v); 332 369 333 370 void printf() const; … … 401 438 }; 402 439 440 typedef Mat4<half> f16mat4; 403 441 typedef Mat4<float> mat4; 404 typedef Mat4<int> imat4; 442 typedef Mat4<int8_t> i8mat4; 443 typedef Mat4<uint8_t> u8mat4; 444 typedef Mat4<int16_t> i16mat4; 445 typedef Mat4<uint16_t> u16mat4; 446 typedef Mat4<int32_t> imat4; 447 typedef Mat4<uint32_t> umat4; 448 typedef Mat4<int64_t> i64mat4; 449 typedef Mat4<uint64_t> u64mat4; 405 450 406 451 } /* namespace lol */
Note: See TracChangeset
for help on using the changeset viewer.