Added Matrix4::(Make)Transform(T, R)

Former-commit-id: 556554c8cc589dfe64b3a8be903f62af894011c4
This commit is contained in:
Lynix
2013-05-03 02:50:38 +02:00
parent f694c3be40
commit a8066a58af
2 changed files with 20 additions and 1 deletions

View File

@@ -561,7 +561,7 @@ NzMatrix4<T>& NzMatrix4<T>::MakeTranslation(const NzVector3<T>& translation)
}
template<typename T>
NzMatrix4<T>& NzMatrix4<T>::MakeTransform(const NzVector3<T>& translation, const NzQuaternion<T>& rotation, const NzVector3<T>& scale)
NzMatrix4<T>& NzMatrix4<T>::MakeTransform(const NzVector3<T>& translation, const NzQuaternion<T>& rotation)
{
// La rotation et la translation peuvent être appliquées directement
SetRotation(rotation);
@@ -573,6 +573,14 @@ NzMatrix4<T>& NzMatrix4<T>::MakeTransform(const NzVector3<T>& translation, const
m34 = F(0.0);
m44 = F(1.0);
return *this;
}
template<typename T>
NzMatrix4<T>& NzMatrix4<T>::MakeTransform(const NzVector3<T>& translation, const NzQuaternion<T>& rotation, const NzVector3<T>& scale)
{
MakeTransform(translation, rotation);
// Ensuite on fait une mise à l'échelle des valeurs déjà présentes
ApplyScale(scale);
@@ -919,6 +927,15 @@ NzMatrix4<T> NzMatrix4<T>::Translate(const NzVector3<T>& translation)
return mat;
}
template<typename T>
NzMatrix4<T> NzMatrix4<T>::Transform(const NzVector3<T>& translation, const NzQuaternion<T>& rotation)
{
NzMatrix4 mat;
mat.MakeTransform(translation, rotation);
return mat;
}
template<typename T>
NzMatrix4<T> NzMatrix4<T>::Transform(const NzVector3<T>& translation, const NzQuaternion<T>& rotation, const NzVector3<T>& scale)
{