libgdx / fbx-conv

Command line utility using the FBX SDK to convert FBX/Collada/Obj files to a custom text/binary format for static, keyframed and skinned meshes.
Apache License 2.0
447 stars 117 forks source link

Converter often drops last animation frame. #41

Closed titovmaxim closed 10 years ago

titovmaxim commented 10 years ago

Often converter drops the last animation frame which leads to animation jitter on looping. The reason is "for" loop over float variable and rounding imperfectness (Fbx.Converter.h, line 612) at the last loop iteration.

Somehow I can not make a pull request. The fast solution is to: replace Fbx.Converter.h, line 612 from: for (float time = (_itr).second.start; time <= (_itr).second.stop; time += stepSize) { to: const float last = (_itr).second.stop + stepSize * 0.5f; for (float time = (_itr).second.start; time <= last; time += stepSize) {

Afterwards it works.

xoppa commented 10 years ago

Thanks, I will have a look at it.