Commit 073114a5 authored by Jan Möbius's avatar Jan Möbius
Browse files

Made interpolate function a template to allow other vector types than std::vector

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15494 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a0c69d34
......@@ -322,8 +322,8 @@ namespace ACG {
//-----------------------------------------------------------------------------
/// linear interpolation of dual quaternions. Result is normalized afterwards.
template <typename Scalar>
DualQuaternionT<Scalar> DualQuaternionT<Scalar>::interpolate(std::vector<double>& _weights, const std::vector<DualQuaternion>& _dualQuaternions)
template <typename Scalar> template<typename VectorType>
DualQuaternionT<Scalar> DualQuaternionT<Scalar>::interpolate(VectorType& _weights, const std::vector<DualQuaternion>& _dualQuaternions)
{
if ( (_weights.size() != _dualQuaternions.size()) || (_weights.size() == 0) ){
std::cerr << "Cannot interpolate dual quaternions ( weights: " << _weights.size() << ", DQs: " << _dualQuaternions.size() << std::endl;
......
......@@ -168,7 +168,8 @@ public:
Scalar& operator [](const unsigned int& b);
/// linear interpolation of dual quaternions. Result is normalized afterwards
static DualQuaternion interpolate(std::vector<double>& _weights, const std::vector<DualQuaternion>& _dualQuaternions);
template <typename VectorType>
static DualQuaternion interpolate(VectorType& _weights, const std::vector<DualQuaternion>& _dualQuaternions);
/// Transform a point with the dual quaternion
Vec3 transform_point(const Vec3& _point) const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment