diff options
author | Mike Krus <mike.krus@kdab.com> | 2018-04-04 09:53:27 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2018-04-09 11:51:08 +0000 |
commit | 5247d7146c65672bd245ceb0dc213dfb319919c4 (patch) | |
tree | 87159d0f24af725bb7c01c7495d71b3cc4bc76c2 /src/3rdparty/assimp/code/TargetAnimation.cpp | |
parent | af4972fd15e6b11a99c631ff91b3360ceb8be5cc (diff) |
Update Assimp to 4.1
Fixes build with C++17 / XCode 9.3
Change-Id: Ic1c19cc4b86e54e72dd4cfe054ec6d66f64b5a07
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/3rdparty/assimp/code/TargetAnimation.cpp')
-rw-r--r-- | src/3rdparty/assimp/code/TargetAnimation.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/3rdparty/assimp/code/TargetAnimation.cpp b/src/3rdparty/assimp/code/TargetAnimation.cpp index a78f66bea..ab6b3d12f 100644 --- a/src/3rdparty/assimp/code/TargetAnimation.cpp +++ b/src/3rdparty/assimp/code/TargetAnimation.cpp @@ -2,7 +2,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2017, assimp team + All rights reserved. Redistribution and use of this software in source and binary forms, @@ -83,7 +84,7 @@ KeyIterator::KeyIterator(const std::vector<aiVectorKey>* _objPos, // ------------------------------------------------------------------------------------------------ template <class T> -inline T Interpolate(const T& one, const T& two, float val) +inline T Interpolate(const T& one, const T& two, ai_real val) { return one + (two-one)*val; } @@ -100,8 +101,8 @@ void KeyIterator::operator ++() // to our current position on the time line double d0,d1; - d0 = objPos->at ( std::min<unsigned int> ( nextObjPos, objPos->size()-1) ).mTime; - d1 = targetObjPos->at( std::min<unsigned int> ( nextTargetObjPos, targetObjPos->size()-1) ).mTime; + d0 = objPos->at ( std::min ( nextObjPos, static_cast<unsigned int>(objPos->size()-1)) ).mTime; + d1 = targetObjPos->at( std::min ( nextTargetObjPos, static_cast<unsigned int>(targetObjPos->size()-1)) ).mTime; // Easiest case - all are identical. In this // case we don't need to interpolate so we can @@ -134,7 +135,7 @@ void KeyIterator::operator ++() const aiVectorKey& last = targetObjPos->at(nextTargetObjPos); const aiVectorKey& first = targetObjPos->at(nextTargetObjPos-1); - curTargetPosition = Interpolate(first.mValue, last.mValue, (float) ( + curTargetPosition = Interpolate(first.mValue, last.mValue, (ai_real) ( (curTime-first.mTime) / (last.mTime-first.mTime) )); } @@ -155,7 +156,7 @@ void KeyIterator::operator ++() const aiVectorKey& last = objPos->at(nextObjPos); const aiVectorKey& first = objPos->at(nextObjPos-1); - curPosition = Interpolate(first.mValue, last.mValue, (float) ( + curPosition = Interpolate(first.mValue, last.mValue, (ai_real) ( (curTime-first.mTime) / (last.mTime-first.mTime))); } @@ -220,7 +221,7 @@ void TargetAnimationHelper::Process(std::vector<aiVectorKey>* distanceTrack) // diff vector aiVector3D diff = tposition - position; - float f = diff.Length(); + ai_real f = diff.Length(); // output distance vector if (f) |