Best practices to programmatically animate spatials?


following this post, I’ve been able to:

  • create the SQL table theater
  • display the tables in the theater
  • implement my own keyboard and mouse controller
  • highlight parents (red) and children (blue) tables for a selected table (the one the mouse cursor is over; in green here)

    I’m using the GameState framework and now I wish to add some animation.

    In brief, I would like to see the selected table (in green on the screenshot) and its parent (red) and children (blue) tables fly toward the center of the theater (a cylinder) with a little rotation.

    I’ve studied the TestSpatialTransform class and I guess it seems to be what I need. However I have some questions:

    1/ is it possible to “stop the world” once I click on a selected table meaning: stop mouse controller, let the animation end and restart the mouse controller? are there better way to avoid selected table to change?

    2/ would an other state be useful to handle the animation? Sort of “FlyingToMeState”

    3/ If after the animation I want to have a totally new mouse controller (react differently to the previous one)

    should I assign a new one, handle the different kind of reaction in one controller or should I count on a new State class?

    4/ Are there examples for using SpatialTransformer.setNewAnimationTimes(,) method?

    5/ Can I rely on the SpatialTransformer.isActive() method to know when the animation is finished?

    Thanks for your comments,