Ignore:
Timestamp:
Apr 22, 2012, 3:04:00 PM (9 years ago)
Author:
sam
Message:

math: new mat3::scale() and mat4::scale() methods.

File:
1 edited

Legend:

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

    r1270 r1272  
    14541454
    14551455    /* Helpers for transformation matrices */
     1456    static Mat3<T> scale(T x, T y, T z);
     1457    static Mat3<T> scale(Vec3<T> v);
    14561458    static Mat3<T> rotate(T angle, T x, T y, T z);
    14571459    static Mat3<T> rotate(T angle, Vec3<T> v);
     
    15621564    static Mat4<T> translate(T x, T y, T z);
    15631565    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    }
    15641576
    15651577    static inline Mat4<T> translate(Mat4<T> const &mat, Vec3<T> v)
Note: See TracChangeset for help on using the changeset viewer.