From 2da3dd29fcd8a8b4c80edbb3747b0077e9b3fe85 Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Fri, 24 Jan 2014 16:32:54 +0100 Subject: [PATCH] InterpolateOrientation_UsingNonRigidNlerp --- Code/OysterMath/LinearMath.h | 10 ++++++++++ Code/OysterMath/OysterMath.h | 1 + 2 files changed, 11 insertions(+) diff --git a/Code/OysterMath/LinearMath.h b/Code/OysterMath/LinearMath.h index d32ea04f..51feacda 100644 --- a/Code/OysterMath/LinearMath.h +++ b/Code/OysterMath/LinearMath.h @@ -756,6 +756,16 @@ namespace LinearAlgebra3D return rotation; // return no change return SnapAxisYToNormal_UsingNlerp( rotation, interpolated ); } + + template + ::LinearAlgebra::Matrix4x4 & InterpolateOrientation_UsingNonRigidNlerp( const ::LinearAlgebra::Matrix4x4 &start, const ::LinearAlgebra::Matrix4x4 &end, ScalarType t, ::LinearAlgebra::Matrix4x4 &targetMem ) + { + targetMem.v[0] = ::LinearAlgebra::Nlerp( start.v[0], end.v[0], t ); + targetMem.v[1] = ::LinearAlgebra::Nlerp( start.v[1], end.v[1], t ); + targetMem.v[2] = ::LinearAlgebra::Nlerp( start.v[2], end.v[2], t ); + targetMem.v[3] = ::LinearAlgebra::Lerp( start.v[3], end.v[3], t ); + return targetMem; + } } #include "Utilities.h" diff --git a/Code/OysterMath/OysterMath.h b/Code/OysterMath/OysterMath.h index 3770bf02..225705ca 100644 --- a/Code/OysterMath/OysterMath.h +++ b/Code/OysterMath/OysterMath.h @@ -343,6 +343,7 @@ namespace Oyster { namespace Math3D //! Oyster's native math library specialized using ::LinearAlgebra3D::SnapAxisYToNormal_UsingNlerp; using ::LinearAlgebra3D::InterpolateAxisYToNormal_UsingNlerp; + using ::LinearAlgebra3D::InterpolateOrientation_UsingNonRigidNlerp; } } #endif \ No newline at end of file