summaryrefslogtreecommitdiff
path: root/slideshow/source/inc/box2dtools.hxx
diff options
context:
space:
mode:
authorSarper Akdemir <q.sarperakdemir@gmail.com>2020-08-25 11:24:22 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-08-26 14:47:52 +0200
commitd29c27af4aff3f5268bd4a07647fd7435603ba11 (patch)
tree9c3ca6917490e3e5b4146beeb6d9fe1d8030e761 /slideshow/source/inc/box2dtools.hxx
parentf070bea92f2d494fc3da6fb2fab7b9c283955f5d (diff)
tdf#136097: make physics animation effects handle skips and rewinds
Making box2d world only stay populated when there's an animation effect going on. This makes it possible to get rid of big chunk of sequential update implementation. Change-Id: Iaf50d4871b2355035495618354f0ae09abe94164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101304 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'slideshow/source/inc/box2dtools.hxx')
-rw-r--r--slideshow/source/inc/box2dtools.hxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/slideshow/source/inc/box2dtools.hxx b/slideshow/source/inc/box2dtools.hxx
index 0debf1da4ef0..6bfc9dfd1b7c 100644
--- a/slideshow/source/inc/box2dtools.hxx
+++ b/slideshow/source/inc/box2dtools.hxx
@@ -65,13 +65,6 @@ struct Box2DDynamicUpdateInformation
int mnDelayForSteps = 0;
};
-union Box2DStaticUpdateInformation {
- ::basegfx::B2DPoint maPosition;
- bool mbVisibility;
- double mfAngle;
- Box2DStaticUpdateInformation() {}
-};
-
/** Class that manages the Box2D World
This class is used when there's a simulated animation going on,
@@ -89,16 +82,12 @@ private:
/// Holds whether or not there is a Physics Animation node that
/// is stepping the Box2D World
bool mbHasWorldStepper;
+ int mnPhysicsAnimationCounter;
std::unordered_map<css::uno::Reference<css::drawing::XShape>, Box2DBodySharedPtr>
mpXShapeToBodyMap;
/// Holds any information needed to keep LO animations and Box2D world in sync
/// if they are going in parallel
std::queue<Box2DDynamicUpdateInformation> maShapeParallelUpdateQueue;
- /// Holds necessary information to update a shape's body that was altered by an
- /// animation effect while there was no Physics Animation going in parallel
- std::map<std::pair<css::uno::Reference<css::drawing::XShape>, box2DNonsimulatedShapeUpdateType>,
- Box2DStaticUpdateInformation>
- maShapeSequentialUpdate;
/// Creates a static frame in Box2D world that corresponds to the slide borders
void createStaticFrameAroundSlide(const ::basegfx::B2DVector& rSlideSize);
@@ -270,7 +259,11 @@ public:
void queueShapeAnimationEndUpdate(const css::uno::Reference<css::drawing::XShape>& xShape,
const slideshow::internal::AttributeType eAttrType);
- void alertAnimationEndForShape(const slideshow::internal::ShapeSharedPtr& pShape);
+ void alertPhysicsAnimationEnd(const slideshow::internal::ShapeSharedPtr& pShape);
+
+ void
+ alertPhysicsAnimationStart(const ::basegfx::B2DVector& rSlideSize,
+ const slideshow::internal::ShapeManagerSharedPtr& pShapeManager);
};
/// Class that manages a single box2D Body