There is a hello animation example, where, apparently, predefined character with predefined animations is used.
But what if I want to create some animation on-the-fly, programmatically? Suppose I want just cube perform some movements and rotations?
I found a class Animation
which allows adding a tracks. One of the tracks type is SpatialTrack
which has obvious structure: it apparently consists of a series of transformations and rotations over time.
But what to do with such an object, once it was created? How to "apply" or "execute" it on some geometry?
UPDATE
I found another pattern: first create MotionPath
, then wrap it into MotionEvent
and then add resulting object to the object you want to behave with addControl()
method. Probably object will follow the path. Unfortunately, I can't find, how to set the orientation. Despite the fact that MotionEvent
class has getRotation()
method, which is documented as returning rotation of target object, I can't see any methods to set rotations in MotionPath
, which constitues the MotionEvent
.