At the start of the week, my initial goal was to create functions that set up and manage Box2D worlds based on the current slide from LibreOffice.
While constructing these functions, I’ve hoped to get a more solid understanding of what kind of parameters will be needed for these functions, and whether or not I can easily access these parameters from the animation engine.
I think, having this knowledge will help me structure the project in a more rigid manner on upcoming weeks and, help me have a vision about the project that is in touch with reality.
So, to achieve this I started by implementing two new classes, one that manages Box2D Worlds and one that manages Box2D Bodies.
box2DWorld class creates a Box2D World (b2World) by taking in slide size and constructing a four wall frame around the slide. It has a function to create a Box2D Body (b2Body) from a shape reference and represent the shape as its bounding box in the b2World. Also has the required step function to step through time in the b2World.
box2DBody class has get functions that return LibreOffice types for convenience.
Said implementation is still a WIP and can be checked at https://gerrit.libreoffice.org/c/core/+/95614
Later to test these implemented classes in action I’ve modified slideshow::internal::PathAnimation to use the newly implemented classes. Additionally added a hard coded static body in the lower middle of the world that is represented by a red square in the following demonstration video:
Please accept YouTube cookies to play this video. By accepting you will be accessing content from YouTube, a service provided by an external third party.
If you accept this notice, your choice will be saved and the page will refresh.
A instance of LibreOffice I’ve hacked together for the demo exist on: https://github.com/Quwex/core/tree/gsoc-box2d-experimental