Ignore:
Timestamp:
Sep 24, 2012, 8:44:37 AM (8 years ago)
Author:
sam
Message:

math: add a uniform scaling matrix constructor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/math/vector.cpp

    r1807 r1947  
    304304           << ", " << m[2][3] << ", " << m[3][3] << "))";
    305305    return stream;
     306}
     307
     308template<> mat3 mat3::scale(float x)
     309{
     310    mat3 ret(1.0f);
     311
     312    ret[0][0] = x;
     313    ret[1][1] = x;
     314    ret[2][2] = x;
     315
     316    return ret;
    306317}
    307318
Note: See TracChangeset for help on using the changeset viewer.