Playground: Use new Enki viewer with picking
This PR extracts from Titwin/aseba-INRIA@e2a61a832ae37955c5715472fa494712c594009b a minimal set of changes to allow Aseba Playground to use the new Enki viewer with picking. The new Enki viewer is not a drop-in replacement for Enki 2.0.0 and changes to client code are needed.
Changes in this PR:
- QTimerEvents must hand off to the new
Enki::ViewerWidget::timerEvent
, which counts milliseconds. If timer events are not handled correctly, picking will not work. AStartSimulation
hook is used to start the timer. -
Aseba::PlaygroundViewer
is a QMainWindow with a layout. It is not a derived class ofEnki::ViewerWidget
but does contain one. - Playground objects with finite mass are flagged as movable by picking.
Note that Titwin/aseba-INRIA master contains other improvements to the GUI that are not included in this PR.
TODO: add a check for the Enki version (which version?) in targets/playground/CMakeLists.txt. If we want backwards compatibility with Enki 2.0.0, we will need to add conditional compilation in 7 places.