path: root/slideshow/README
diff options
authorSarper Akdemir <>2020-08-27 17:08:38 +0300
committerThorsten Behrens <>2020-08-31 12:25:59 +0200
commit8e36582d9289c3774f2733b021fafc93370cffae (patch)
treeb007d4944f5ed342b1051e4a8785cd359d843236 /slideshow/README
parent55dda1367a845b37184cedc287e5f8f03ef0f6cf (diff)
document physics animations and related code
Change-Id: I1369588dd757d5fedcd7e91eabe0020e5cf60c56 Reviewed-on: Tested-by: Jenkins Reviewed-by: Thorsten Behrens <>
Diffstat (limited to 'slideshow/README')
1 files changed, 33 insertions, 0 deletions
diff --git a/slideshow/README b/slideshow/README
index e523458531ae..e67379f43c89 100644
--- a/slideshow/README
+++ b/slideshow/README
@@ -8,3 +8,36 @@ written by GSOC student Shane.M.Mathews. Radek has later polished the
code a bit, added few new 3D transitions, added infrastructure for
vertex and fragment shaders. Wrote few transitions with fragment shader
+== Physics Animation Effects ==
+Physics animation effects are simulated by external 2d physics engine
+library Box2D. They don't directly call Box2D functions but instead
+use the wrapper in:
+* slideshow/source/inc/box2dtools.hxx
+* slideshow/source/engine/box2dtools.cxx
+The wrapper has two corresponding classes to manage the Box2D world
+and Box2D bodies.
+When a physics animation starts, a Box2DWorld is initiated and
+populated with every shape that is part of the foreground (which are
+shapes that do not belong to the master slide and not a background
+After creation until the end of the slide (not the whole slideshow)
+the Box2D World isn't destroyed and reused. But the bodies that
+represent the shapes in the slide get destroyed when there's a point
+in time that there's no physics animation in progress. And recreated
+when another physics animation starts.
+If there are multiple physics animations in parallel only one of them
+takes the role of stepping through the simulation.
+If there are other animation effects that go in parallel which change
+the shape position, rotation, or visibility - they also report the
+change to Box2D World. These updates are collected in a queue in
+Box2DWorld and processed before stepping through the simulation.
+To achieve convincing results these updates are performed by setting
+the box2d body's linear velocity or angular velocity instead of
+setting directly it's position or rotation.