Changeset 1264 for trunk


Ignore:
Timestamp:
Apr 21, 2012, 9:45:09 PM (8 years ago)
Author:
sam
Message:

math: allow to easily create a 4x4 matrix from a 3x3 matrix, and so on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/vector.h

    r1259 r1264  
    14351435        v2((T)0, (T)0, val) {}
    14361436
     1437    explicit inline Mat3(Mat2<T> mat)
     1438      : v0(mat[0], (T)0),
     1439        v1(mat[1], (T)0),
     1440        v2((T)0, (T)0, (T)0) {}
     1441
     1442    explicit inline Mat3(Mat2<T> mat, T val)
     1443      : v0(Vec3<T>(mat[0], (T)0)),
     1444        v1(Vec3<T>(mat[1], (T)0)),
     1445        v2((T)0, (T)0, val) {}
     1446
    14371447    explicit inline Mat3(Mat4<T> const &mat)
    14381448      : v0(mat[0].xyz),
     
    15201530        v1((T)0, val, (T)0, (T)0),
    15211531        v2((T)0, (T)0, val, (T)0),
     1532        v3((T)0, (T)0, (T)0, val) {}
     1533
     1534    explicit inline Mat4(Mat2<T> mat)
     1535      : v0(mat[0], (T)0, (T)0),
     1536        v1(mat[1], (T)0, (T)0),
     1537        v2((T)0, (T)0, (T)0, (T)0),
     1538        v3((T)0, (T)0, (T)0, (T)0) {}
     1539
     1540    explicit inline Mat4(Mat2<T> mat, T val1, T val2)
     1541      : v0(mat[0], (T)0, (T)0),
     1542        v1(mat[1], (T)0, (T)0),
     1543        v2((T)0, (T)0, val1, (T)0),
     1544        v3((T)0, (T)0, (T)0, val2) {}
     1545
     1546    explicit inline Mat4(Mat3<T> mat)
     1547      : v0(mat[0], (T)0),
     1548        v1(mat[1], (T)0),
     1549        v2(mat[2], (T)0),
     1550        v3((T)0, (T)0, (T)0, (T)0) {}
     1551
     1552    explicit inline Mat4(Mat3<T> mat, T val)
     1553      : v0(mat[0], (T)0),
     1554        v1(mat[1], (T)0),
     1555        v2(mat[2], (T)0),
    15221556        v3((T)0, (T)0, (T)0, val) {}
    15231557
Note: See TracChangeset for help on using the changeset viewer.