Inviwo
0.9.10.1
Inviwo documentation
|
#include <animationstate.h>
Public Member Functions | |
Seconds | getFirstTime () const |
void | setFirstTime (const Seconds timeValue) |
Seconds | getLastTime () const |
void | setLastTime (const Seconds timeValue) |
int | getNumFrames () const |
bool | setNumFrames (const int desiredFrames) |
double | getFramesPerSecond () const |
Returns the frames per second. | |
bool | setFramesPerSecond (const double desiredFPS) |
bool | operator!= (const AnimationPlaySettings &other) const |
Public Attributes | |
PlaybackMode | mode |
Protected Attributes | |
Seconds | firstTime |
Seconds | lastTime |
int | numFrames |
Number of frames to generate between firstTime and lastTime. | |
double | framesPerSecond |
Frames per second. | |
Keeps animation settings related to playing or rendering.
The settings allow to work either with numFrames or framesPerSecond. If one is set, the other is computed accordingly in order to stay consistent.
The parameters firstTime and lastTime do not need to coincide with the corresponding parameters of the animation. We can choose a smaller time window here, or a larger one just as well. No harm in doing the latter.
The smallest numFrames is 2, since we will visit at least firstTime and lastTime during an animation or rendering. The smallest framesPerSecond is 1e-3, as an arbitrary but positive, non-zero minimum.
int inviwo::animation::AnimationPlaySettings::getNumFrames | ( | ) | const |
Returns the number of frames to be rendered between firstTime and lastTime given the current @framesPerSecond.
bool inviwo::animation::AnimationPlaySettings::setFramesPerSecond | ( | const double | desiredFPS | ) |
Sets the frames per second for the animation playback, and adjusts numFrames accordingly. The smallest @framesPerSecond is 1e-3, as an arbitrary but positive, non-zero minimum.
bool inviwo::animation::AnimationPlaySettings::setNumFrames | ( | const int | desiredFrames | ) |
Sets the number of frames to be rendered between firstTime and lastTime, and adjusts framesPerSecond accordingly.
The smallest numFrames is 2, since we will visit at least firstTime and lastTime during an animation or rendering.