The Animation Motor addon class.
All animation motor addon have to inherit from this class (which is an interface).
I highly recommand a look/study/thesis at/on the code of the ShakerAnimationMotorAddon class. It gives an good idea of all the different facets of a animation motor addon.
virtual Loads* AnimationMotorAddon::doMove |
( |
double |
dt, |
|
|
double |
forcedTime = 0.0 |
|
) |
| |
|
pure virtual |
This method is called everytime the motor has to do one step of simulation.
I.e. this method is called everytime the application needs to know the positions of the atoms at time t+dt.
Note: There are two possibilities for motors to produce deformations:
- Either by returning a Loads* filled up with the appropriate translations,
- or by modifying directly the position of the atoms. In this case doMove(..) must return NULL. It is a kind of "direct rendering".
The latter is around 5% faster when a big percentage of the atoms are moving due to the action of the motor; consequently for a very low 3D refresh rate, the speed difference can become quite important. It is strongly advise to decrease the 3D refresh rate and use direct rendering.
The two methods are provided for convenience (sometimes it is easier to produce loads, and sometimes easier to directly modify the atom positions).
Again, see the artistic effect ShakerAnimationMotorAddon for more infos and examples (you could also use the shaker to check performances for your objects).
The Loads * boundaryConditions object can be used here to set initial boundary conditions.
The second paramater allows you to do more than one motor loop, if non zero it means that the motor can compute all the iterations up to time=forcedTime without producing any loads or updating any positions, making the motor faster.
- Parameters
-
dt | the delta-t to use in the motor |
forcedTime | the time at which the user wants a result |
- Returns
- the list of loads produce by the motor