Changeset 1258 for trunk/src/lol/math/vector.h
 Timestamp:
 Apr 21, 2012, 6:58:30 PM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/lol/math/vector.h
r1257 r1258 1352 1352 v1((T)0, val) {} 1353 1353 1354 explicit inline Mat2(Mat4<T> const &mat) 1355 : v0(mat[0].xy), 1356 v1(mat[1].xy) {} 1357 1354 1358 inline Vec2<T>& operator[](size_t n) { return (&v0)[n]; } 1355 1359 inline Vec2<T> const& operator[](size_t n) const { return (&v0)[n]; } … … 1431 1435 v2((T)0, (T)0, val) {} 1432 1436 1437 explicit inline Mat3(Mat4<T> const &mat) 1438 : v0(mat[0].xyz), 1439 v1(mat[1].xyz), 1440 v2(mat[2].xyz) {} 1441 1433 1442 inline Vec3<T>& operator[](size_t n) { return (&v0)[n]; } 1434 1443 inline Vec3<T> const& operator[](size_t n) const { return (&v0)[n]; } … … 1442 1451 { 1443 1452 return rotate(angle, v) * mat; 1453 } 1454 1455 static Mat3<T> normal(Mat3<T> const &mat) 1456 { 1457 return transpose(inverse(mat)); 1444 1458 } 1445 1459 … … 1533 1547 } 1534 1548 1535 static Mat3<T> normal(Mat4<T> const &mat); 1549 static Mat3<T> normal(Mat4<T> const &mat) 1550 { 1551 return transpose(inverse(Mat3<T>(mat))); 1552 } 1536 1553 1537 1554 /* Helpers for view matrices */
Note: See TracChangeset
for help on using the changeset viewer.