matrix: add affine scale implementation

This commit is contained in:
Danny Robson 2014-12-16 15:28:40 +11:00
parent af3adb9ff1
commit ede1203ff7

View File

@ -515,6 +515,20 @@ matrix<T>::translate (util::vector<3,T> v)
}
//-----------------------------------------------------------------------------
template <typename T>
matrix<T>
matrix<T>::scale (util::vector<3,T> v)
{
return { {
{ v.x, 0.f, 0.f, 0.f },
{ 0.f, v.y, 0.f, 0.f },
{ 0.f, 0.f, v.z, 0.f },
{ 0.f, 0.f, 0.f, 1.f }
} };
}
//-----------------------------------------------------------------------------
template <typename T>
const matrix<T>