Added ScalingMatrix function

This commit is contained in:
Dander7BD 2014-02-10 13:41:37 +01:00
parent 0153be16d5
commit 4fb684019c
2 changed files with 20 additions and 0 deletions

View File

@ -392,6 +392,25 @@ namespace LinearAlgebra3D
// return ::std::asin( ::LinearAlgebra::Vector4<ScalarType>(orientationMatrix.v[1].z, orientationMatrix.v[2].x, orientationMatrix.v[0].y, 0) ); // return ::std::asin( ::LinearAlgebra::Vector4<ScalarType>(orientationMatrix.v[1].z, orientationMatrix.v[2].x, orientationMatrix.v[0].y, 0) );
//} //}
template<typename ScalarType>
inline ::LinearAlgebra::Matrix4x4<ScalarType> ScalingMatrix( const ::LinearAlgebra::Vector3<ScalarType> &s )
{
return ::LinearAlgebra::Matrix4x4<ScalarType>( s.x, 0, 0, 0,
0, s.y, 0, 0,
0, 0, s.z, 0,
0, 0, 0, 1 );
}
template<typename ScalarType>
inline ::LinearAlgebra::Matrix4x4<ScalarType> ScalingMatrix( const ::LinearAlgebra::Vector4<ScalarType> &s )
{
return ::LinearAlgebra::Matrix4x4<ScalarType>( s.x, 0, 0, 0,
0, s.y, 0, 0,
0, 0, s.z, 0,
0, 0, 0, s.w );
}
template<typename ScalarType> template<typename ScalarType>
inline ::LinearAlgebra::Matrix4x4<ScalarType> & TranslationMatrix( const ::LinearAlgebra::Vector3<ScalarType> &position, ::LinearAlgebra::Matrix4x4<ScalarType> &targetMem = ::LinearAlgebra::Matrix4x4<ScalarType>() ) inline ::LinearAlgebra::Matrix4x4<ScalarType> & TranslationMatrix( const ::LinearAlgebra::Vector3<ScalarType> &position, ::LinearAlgebra::Matrix4x4<ScalarType> &targetMem = ::LinearAlgebra::Matrix4x4<ScalarType>() )
{ {

View File

@ -332,6 +332,7 @@ namespace Oyster { namespace Math3D //! Oyster's native math library specialized
using ::LinearAlgebra3D::InterpolateOrientation_UsingSlerp; using ::LinearAlgebra3D::InterpolateOrientation_UsingSlerp;
using ::LinearAlgebra3D::SnapAngularAxis; using ::LinearAlgebra3D::SnapAngularAxis;
using ::LinearAlgebra3D::WorldAxisOf; using ::LinearAlgebra3D::WorldAxisOf;
using ::LinearAlgebra3D::ScalingMatrix;
} } } }
#endif #endif