diff --git a/Code/OysterMath/LinearMath.h b/Code/OysterMath/LinearMath.h index 18c80cf1..0d02616e 100644 --- a/Code/OysterMath/LinearMath.h +++ b/Code/OysterMath/LinearMath.h @@ -392,6 +392,25 @@ namespace LinearAlgebra3D // return ::std::asin( ::LinearAlgebra::Vector4(orientationMatrix.v[1].z, orientationMatrix.v[2].x, orientationMatrix.v[0].y, 0) ); //} + + template + inline ::LinearAlgebra::Matrix4x4 ScalingMatrix( const ::LinearAlgebra::Vector3 &s ) + { + return ::LinearAlgebra::Matrix4x4( s.x, 0, 0, 0, + 0, s.y, 0, 0, + 0, 0, s.z, 0, + 0, 0, 0, 1 ); + } + + template + inline ::LinearAlgebra::Matrix4x4 ScalingMatrix( const ::LinearAlgebra::Vector4 &s ) + { + return ::LinearAlgebra::Matrix4x4( s.x, 0, 0, 0, + 0, s.y, 0, 0, + 0, 0, s.z, 0, + 0, 0, 0, s.w ); + } + template inline ::LinearAlgebra::Matrix4x4 & TranslationMatrix( const ::LinearAlgebra::Vector3 &position, ::LinearAlgebra::Matrix4x4 &targetMem = ::LinearAlgebra::Matrix4x4() ) { diff --git a/Code/OysterMath/OysterMath.h b/Code/OysterMath/OysterMath.h index a98663cd..4449db83 100644 --- a/Code/OysterMath/OysterMath.h +++ b/Code/OysterMath/OysterMath.h @@ -332,6 +332,7 @@ namespace Oyster { namespace Math3D //! Oyster's native math library specialized using ::LinearAlgebra3D::InterpolateOrientation_UsingSlerp; using ::LinearAlgebra3D::SnapAngularAxis; using ::LinearAlgebra3D::WorldAxisOf; + using ::LinearAlgebra3D::ScalingMatrix; } } #endif \ No newline at end of file