Skip to main content
Version: 🚧 Nightly

Class f3d::animation

Definition: animation.h (line 18)

abstract to handle animation control in the libf3d

A class to control everything related to animation in the libf3d. It recovers information from the currently loaded files in the scene.

Members​

Public types​

Enumeration type Direction​

Definition: animation.h (line 69)

enum Direction {
FORWARD,
BACKWARD
}

Enumeration of animation direction.

Enumerator FORWARD​

Enumerator BACKWARD​

Public functions​

Function loadTime​

virtual animation & f3d::animation::loadTime(double timeValue)=0

Load files in the scene at provided time value if they contain any animation Providing a time value outside of the current animation time range will clamp to the closest value in the range. Does not do anything if there is no animations.

Parameters:

  • double timeValue

Return type: animation &

Function getTimeRange​

virtual std::pair< double, double > f3d::animation::getTimeRange()=0

Get animation time range of currently added files in the scene. Returns [0, 0] if there is no animations.

Return type: std::pair< double, double >

Function getKeyFrames​

virtual std::vector< double > f3d::animation::getKeyFrames()=0

Get animation key frame's time of currently added files. Can be used in loadTime to request a specific key frame. Returns empty vector if there is no animations.

Return type: std::vector< double >

Function count​

virtual unsigned int f3d::animation::count() const =0

Return the number of animations available in the currently loaded files.

Return type: unsigned int

Function getName​

virtual std::string f3d::animation::getName(std::optional< int > index=std::nullopt) const =0

Return the animation name of a given animation index, if any.

Specific animation (0..count): Returns the name of the animation at that index, or or current animation name if no index is provided.

  • Returns the name of the current animation

  • Returns "Multi animations" if more than one animation is current

  • Returns "All animations" if all animations are current

  • Returns "No animations" if no animations are current Fallback: Returns "No animation" for out-of-bounds requests.

Parameters:

  • std::optional< int > index = std::nullopt

Return type: std::string

Function getNames​

virtual std::vector< std::string > f3d::animation::getNames() const =0

Return all of the animation names, if any. Returns a vector of length 0 if none.

Return type: std::vector< std::string >

Function toggle​

virtual animation & f3d::animation::toggle(Direction direction=Direction::FORWARD)=0

Set the animation direction in the provided direction then toggle (start if stopped or stop is started) the animation.

Parameters:

Return type: animation &

Function start​

virtual animation & f3d::animation::start(Direction direction=Direction::FORWARD)=0

Set the animation direction in the provided direction then start the animation if not already started.

Parameters:

Return type: animation &

Function stop​

virtual animation & f3d::animation::stop()=0

Stop the animation if playing.

Return type: animation &

Function isPlaying​

virtual bool f3d::animation::isPlaying()=0

Return if the animation is currently playing or not

Return type: bool

Function getDirection​

virtual animation::Direction f3d::animation::getDirection()=0

Return the animation direction, default is Direction::FORWARD

Return type: animation::Direction