When animating backward: Allow one non-conforming shape
This commit is contained in:
parent
14969afab7
commit
d777f760d5
|
@ -39,13 +39,13 @@ JoiningContinuousTimeline<Shape> animateRough(const ContinuousTimeline<ShapeRule
|
||||||
const centiseconds anticipationDuration = anticipatedShapeStart - anticipatingShapeStart;
|
const centiseconds anticipationDuration = anticipatedShapeStart - anticipatingShapeStart;
|
||||||
if (anticipationDuration > maxAnticipationDuration) break;
|
if (anticipationDuration > maxAnticipationDuration) break;
|
||||||
|
|
||||||
// Make sure the new, backwards-animated shape still resembles the anticipated shape
|
|
||||||
const Shape anticipatingShape = getClosestShape(referenceShape, std::get<ShapeSet>(reverseIt->getValue()));
|
|
||||||
if (getBasicShape(anticipatingShape) != getBasicShape(anticipatedShape)) break;
|
|
||||||
|
|
||||||
// Overwrite forward-animated shape with backwards-animated, anticipating shape
|
// Overwrite forward-animated shape with backwards-animated, anticipating shape
|
||||||
|
const Shape anticipatingShape = getClosestShape(referenceShape, std::get<ShapeSet>(reverseIt->getValue()));
|
||||||
shapes.set(reverseIt->getTimeRange(), anticipatingShape);
|
shapes.set(reverseIt->getTimeRange(), anticipatingShape);
|
||||||
|
|
||||||
|
// Make sure the new, backwards-animated shape still resembles the anticipated shape
|
||||||
|
if (getBasicShape(anticipatingShape) != getBasicShape(anticipatedShape)) break;
|
||||||
|
|
||||||
referenceShape = anticipatingShape;
|
referenceShape = anticipatingShape;
|
||||||
}
|
}
|
||||||
lastAnticipatedShapeStart = anticipatedShapeStart;
|
lastAnticipatedShapeStart = anticipatedShapeStart;
|
||||||
|
|
Loading…
Reference in New Issue