Closed infosia closed 3 years ago
Hi, I happened to find a potential issue in gltf2ozz.cc where node transform is not updated correctly.
gltf2ozz.cc
https://github.com/guillaumeblanc/ozz-animation/blob/master/src/animation/offline/gltf/gltf2ozz.cc#L431-L435
ozz::math::SimdFloat4 translation, rotation, scale; if (ToAffine(matrix, &translation, &rotation, &scale)) { ozz::math::Store3PtrU(translation, &_transform->translation.x); ozz::math::StorePtrU(translation, &_transform->rotation.x); ozz::math::Store3PtrU(translation, &_transform->scale.x); return true; }
If I understand correctly rotation and scale is not updated there. It should be -
rotation
scale
ozz::math::SimdFloat4 translation, rotation, scale; if (ToAffine(matrix, &translation, &rotation, &scale)) { ozz::math::Store3PtrU(translation, &_transform->translation.x); ozz::math::StorePtrU(rotation, &_transform->rotation.x); ozz::math::Store3PtrU(scale, &_transform->scale.x); return true; }
Sorry I just reviewed your code in the browser now and did not do any tests. Please close this if I said something stupid.
Hi,
you're absolutely right! Seems that this case isn't covered by testing either.
Would be awesome if you could do a pull request to fix it. Can you?
Thanks a lot, Guillaume
Pushed PR #116 👍
Hi, I happened to find a potential issue in
gltf2ozz.cc
where node transform is not updated correctly.https://github.com/guillaumeblanc/ozz-animation/blob/master/src/animation/offline/gltf/gltf2ozz.cc#L431-L435
If I understand correctly
rotation
andscale
is not updated there. It should be -Sorry I just reviewed your code in the browser now and did not do any tests. Please close this if I said something stupid.