Merge pull request #4554 from Nor-s/fix_fbx
Fix Import a specific FBX model will freeze the app #4395pull/4565/head
commit
49fdd12fdf
|
@ -3318,9 +3318,9 @@ FBXConverter::KeyFrameListList FBXConverter::GetRotationKeyframeList(const std::
|
||||||
float vc = curve->GetValues().at(1);
|
float vc = curve->GetValues().at(1);
|
||||||
for (size_t n = 1; n < count; n++) {
|
for (size_t n = 1; n < count; n++) {
|
||||||
while (std::abs(vc - vp) >= 180.0f) {
|
while (std::abs(vc - vp) >= 180.0f) {
|
||||||
float step = std::floor(float(tc - tp) / (vc - vp) * 179.0f);
|
double step = std::floor(double(tc - tp) / std::abs(vc - vp) * 179.0f);
|
||||||
int64_t tnew = tp + int64_t(step);
|
int64_t tnew = tp + int64_t(step);
|
||||||
float vnew = vp + (vc - vp) * step / float(tc - tp);
|
float vnew = vp + (vc - vp) * float(step / (tc - tp));
|
||||||
if (tnew >= adj_start && tnew <= adj_stop) {
|
if (tnew >= adj_start && tnew <= adj_stop) {
|
||||||
Keys->push_back(tnew);
|
Keys->push_back(tnew);
|
||||||
Values->push_back(vnew);
|
Values->push_back(vnew);
|
||||||
|
|
Loading…
Reference in New Issue