Linearly interpolate rotation angles with equal direction

Fixes #11808, but still leaves matrix interpolation open.
This commit is contained in:
Michael Howell 2016-06-25 22:35:20 -07:00
parent d3a81373e4
commit e10288ec1c

View file

@ -663,9 +663,14 @@ fn interpolate_transform_list(from_list: &[TransformOperation],
result.push(TransformOperation::Scale(ix, iy, iz)); result.push(TransformOperation::Scale(ix, iy, iz));
} }
(&TransformOperation::Rotate(fx, fy, fz, fa), (&TransformOperation::Rotate(fx, fy, fz, fa),
&TransformOperation::Rotate(_tx, _ty, _tz, _ta)) => { &TransformOperation::Rotate(tx, ty, tz, ta)) => {
// TODO(gw): Implement matrix decomposition and interpolation if fx == tx && fy == ty && fz == tz {
result.push(TransformOperation::Rotate(fx, fy, fz, fa)); let ia = fa.interpolate(&ta, time).unwrap();
result.push(TransformOperation::Rotate(fx, fy, fz, ia));
} else {
// TODO(gw): Implement matrix decomposition and interpolation
result.push(TransformOperation::Rotate(fx, fy, fz, fa));
}
} }
(&TransformOperation::Perspective(fd), (&TransformOperation::Perspective(fd),
&TransformOperation::Perspective(_td)) => { &TransformOperation::Perspective(_td)) => {