diff --git a/Code/OysterMath/LinearMath.h b/Code/OysterMath/LinearMath.h index b8dfe481..0fac61e6 100644 --- a/Code/OysterMath/LinearMath.h +++ b/Code/OysterMath/LinearMath.h @@ -726,6 +726,21 @@ namespace LinearAlgebra3D template inline ::LinearAlgebra::Vector4 NormalProjection( const ::LinearAlgebra::Vector4 &vector, const ::LinearAlgebra::Vector4 &normalizedAxis ) { return normalizedAxis * ( vector.Dot(normalizedAxis) ); } + + template + ::LinearAlgebra::Matrix4x4 & SnapAxisYToAxis_Nlerp( ::LinearAlgebra::Matrix4x4 &rotation, const ::LinearAlgebra::Vector4 &normalizedAxis ) + { + + } + + template + ::LinearAlgebra::Matrix4x4 & InterpolateAxisYToAxis_Nlerp( ::LinearAlgebra::Matrix4x4 &rotation, const ::LinearAlgebra::Vector4 &normalizedAxis, ScalarType t ) + { + ::LinearAlgebra::Vector4 interpolated = ::LinearAlgebra::Nlerp( rotation.v[1], normalizedAxis, t ); + if( interpolated.Dot(interpolated) == 0 ) + return rotation; // return no change + return SnapAxisYToAxis_Nlerp( rotation, interpolated ); + } } #include "Utilities.h"