matrix: add 2d translate convenience function
This commit is contained in:
parent
a300f99b87
commit
0211ed5b37
@ -439,6 +439,15 @@ matrix<T>::look_at (util::point<3,T> eye,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
template <typename T>
|
||||||
|
matrix<T>
|
||||||
|
matrix<T>::translate (util::vector<2,T> v)
|
||||||
|
{
|
||||||
|
return translate ({v.x, v.y, 0});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
matrix<T>
|
matrix<T>
|
||||||
|
@ -67,6 +67,7 @@ namespace util {
|
|||||||
static matrix<T> look_at (point<3,T> eye, point<3,T> centre, vector<3,T> up);
|
static matrix<T> look_at (point<3,T> eye, point<3,T> centre, vector<3,T> up);
|
||||||
|
|
||||||
// Affine matrices
|
// Affine matrices
|
||||||
|
static matrix<T> translate (util::vector<2,T>);
|
||||||
static matrix<T> translate (util::vector<3,T>);
|
static matrix<T> translate (util::vector<3,T>);
|
||||||
static matrix<T> scale (util::vector<3,T>);
|
static matrix<T> scale (util::vector<3,T>);
|
||||||
static matrix<T> scale (T);
|
static matrix<T> scale (T);
|
||||||
|
Loading…
Reference in New Issue
Block a user