Added Matrix4::Apply[Rotation|Translation]
Former-commit-id: 1c59aa48f057d4bdc4b4413e349d2b4290dec055
This commit is contained in:
parent
f712ed1c73
commit
a3f1417abd
|
|
@ -31,7 +31,9 @@ class NzMatrix4
|
|||
NzMatrix4(const NzMatrix4& matrix) = default;
|
||||
~NzMatrix4() = default;
|
||||
|
||||
NzMatrix4& ApplyRotation(const NzQuaternion<T>& rotation);
|
||||
NzMatrix4& ApplyScale(const NzVector3<T>& scale);
|
||||
NzMatrix4& ApplyTranslation(const NzVector3<T>& translation);
|
||||
|
||||
NzMatrix4& Concatenate(const NzMatrix4& matrix);
|
||||
NzMatrix4& ConcatenateAffine(const NzMatrix4& matrix);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue