Added Matrix4::Apply[Rotation|Translation]

Former-commit-id: 1c59aa48f057d4bdc4b4413e349d2b4290dec055
This commit is contained in:
Lynix
2013-06-03 12:57:20 +02:00
parent f712ed1c73
commit a3f1417abd
2 changed files with 19 additions and 0 deletions

View File

@@ -43,6 +43,12 @@ NzMatrix4<T>::NzMatrix4(const NzMatrix4<U>& matrix)
Set(matrix);
}
template<typename T>
NzMatrix4<T>& NzMatrix4<T>::ApplyRotation(const NzQuaternion<T>& rotation)
{
return Concatenate(NzMatrix4f::Rotate(rotation));
}
template<typename T>
NzMatrix4<T>& NzMatrix4<T>::ApplyScale(const NzVector3<T>& scale)
{
@@ -62,6 +68,17 @@ NzMatrix4<T>& NzMatrix4<T>::ApplyScale(const NzVector3<T>& scale)
return *this;
}
template<typename T>
NzMatrix4<T>& NzMatrix4<T>::ApplyTranslation(const NzVector3<T>& translation)
{
m41 += translation.x;
m42 += translation.y;
m43 += translation.z;
m_isIdentity = false;
return *this;
}
template<typename T>
NzMatrix4<T>& NzMatrix4<T>::Concatenate(const NzMatrix4& matrix)
{