mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 16:53:46 +01:00
b3d: Fix rotation interpolation
This commit is contained in:
parent
9a18150304
commit
0f9247c4fd
2
b3d.lua
2
b3d.lua
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user