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/math/vector.cpp

    r1270 r1272  
    307307#endif
    308308
     309template<> 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
     320template<> mat3 mat3::scale(vec3 v)
     321{
     322    return scale(v.x, v.y, v.z);
     323}
     324
    309325template<> mat4 mat4::translate(float x, float y, float z)
    310326{
Note: See TracChangeset for help on using the changeset viewer.