matrix: add scalar multiply
This commit is contained in:
parent
82f318c8ad
commit
dcdbbe938d
12
matrix.cpp
12
matrix.cpp
@ -336,6 +336,18 @@ matrix<T>::operator* (const vector<4> &rhs) const {
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
matrix<T>&
|
||||
matrix<T>::operator*= (T f){
|
||||
for (size_t i = 0; i < 4; ++i)
|
||||
for (size_t j = 0; j < 4; ++j)
|
||||
values[i][j] *= f;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
matrix<T>
|
||||
|
@ -48,8 +48,8 @@ namespace util {
|
||||
matrix<T> operator* (const matrix<T>&) const;
|
||||
vector<4> operator* (const vector<4>&) const;
|
||||
|
||||
matrix<T> operator/ (T) const;
|
||||
|
||||
matrix<T>& operator*= (T);
|
||||
matrix<T> operator/ (T) const;
|
||||
matrix<T>& operator/= (T);
|
||||
|
||||
bool operator== (const matrix<T>&) const;
|
||||
|
Loading…
Reference in New Issue
Block a user