Changeset 1272
 Timestamp:
 Apr 22, 2012, 3:04:00 PM (9 years ago)
 Location:
 trunk/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/lol/math/vector.h
r1270 r1272 1454 1454 1455 1455 /* Helpers for transformation matrices */ 1456 static Mat3<T> scale(T x, T y, T z); 1457 static Mat3<T> scale(Vec3<T> v); 1456 1458 static Mat3<T> rotate(T angle, T x, T y, T z); 1457 1459 static Mat3<T> rotate(T angle, Vec3<T> v); … … 1562 1564 static Mat4<T> translate(T x, T y, T z); 1563 1565 static Mat4<T> translate(Vec3<T> v); 1566 1567 static inline Mat4<T> scale(T x, T y, T z) 1568 { 1569 return Mat4<T>(Mat3<T>::scale(x, y, z), (T)1); 1570 } 1571 1572 static inline Mat4<T> scale(Vec3<T> v) 1573 { 1574 return Mat4<T>(Mat3<T>::scale(v), (T)1); 1575 } 1564 1576 1565 1577 static inline Mat4<T> translate(Mat4<T> const &mat, Vec3<T> v) 
trunk/src/math/vector.cpp
r1270 r1272 307 307 #endif 308 308 309 template<> mat3 mat3::scale(float x, float y, float z) 310 { 311 mat3 ret(1.0f); 312 313 ret[0][0] = x; 314 ret[1][1] = y; 315 ret[2][2] = z; 316 317 return ret; 318 } 319 320 template<> mat3 mat3::scale(vec3 v) 321 { 322 return scale(v.x, v.y, v.z); 323 } 324 309 325 template<> mat4 mat4::translate(float x, float y, float z) 310 326 {
Note: See TracChangeset
for help on using the changeset viewer.