b3d: Fix rotation interpolation

This commit is contained in:
Lars Mueller 2021-04-01 18:45:58 +02:00
parent 9a18150304
commit 0f9247c4fd

@ -329,7 +329,7 @@ function get_animated_bone_properties(self, keyframe, interpolate)
local ratio = (keyframe - a.frame) / (b.frame - a.frame) local ratio = (keyframe - a.frame) / (b.frame - a.frame)
return { return {
position = (a.position and b.position and modlib.vector.interpolate(a.position, b.position, ratio)) or a.position or b.position, position = (a.position and b.position and modlib.vector.interpolate(a.position, b.position, ratio)) or a.position or b.position,
rotation = (a.rotation and b.rotation and modlib.quaternion.interpolate(a.rotation, b.rotation, ratio)) or a.rotation or b.rotation, rotation = (a.rotation and b.rotation and modlib.quaternion.slerp(a.rotation, b.rotation, ratio)) or a.rotation or b.rotation,
scale = (a.scale and b.scale and modlib.vector.interpolate(a.scale, b.scale, ratio)) or a.scale or b.scale, scale = (a.scale and b.scale and modlib.vector.interpolate(a.scale, b.scale, ratio)) or a.scale or b.scale,
} }
end end