Browse Source

Getting rid of <>, part 4: SceneGraph animable and animable group.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
c32c12b387
  1. 8
      src/SceneGraph/Animable.cpp
  2. 107
      src/SceneGraph/Animable.h
  3. 22
      src/SceneGraph/Animable.hpp
  4. 47
      src/SceneGraph/AnimableGroup.h
  5. 16
      src/SceneGraph/SceneGraph.h
  6. 28
      src/SceneGraph/Test/AnimableTest.cpp

8
src/SceneGraph/Animable.cpp

@ -27,10 +27,10 @@
namespace Magnum { namespace SceneGraph {
#ifndef DOXYGEN_GENERATING_OUTPUT
template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>;
template class MAGNUM_SCENEGRAPH_EXPORT Animable<3, Float>;
template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>;
template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3, Float>;
template class MAGNUM_SCENEGRAPH_EXPORT BasicAnimable<2, Float>;
template class MAGNUM_SCENEGRAPH_EXPORT BasicAnimable<3, Float>;
template class MAGNUM_SCENEGRAPH_EXPORT BasicAnimableGroup<2, Float>;
template class MAGNUM_SCENEGRAPH_EXPORT BasicAnimableGroup<3, Float>;
#endif
Debug operator<<(Debug debug, AnimationState value) {

107
src/SceneGraph/Animable.h

@ -25,7 +25,7 @@
*/
/** @file
* @brief Class Magnum::SceneGraph::Animable, enum Magnum::SceneGraph::AnimationState
* @brief Class Magnum::SceneGraph::BasicAnimable, typedef Magnum::SceneGraph::Animable2D, Magnum::SceneGraph::Animable3D, enum Magnum::SceneGraph::AnimationState
*/
#include "AbstractGroupedFeature.h"
@ -37,7 +37,7 @@ namespace Magnum { namespace SceneGraph {
/**
@brief Animation state
@see Animable::setState()
@see BasicAnimable::setState()
*/
enum class AnimationState: UnsignedByte {
/**
@ -56,7 +56,7 @@ enum class AnimationState: UnsignedByte {
Running
};
/** @debugoperator{Magnum::SceneGraph::Animable} */
/** @debugoperator{Magnum::SceneGraph::BasicAnimable} */
Debug MAGNUM_SCENEGRAPH_EXPORT operator<<(Debug debug, AnimationState value);
/**
@ -76,9 +76,9 @@ time and time delta. Example:
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D;
typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<>> Scene3D;
class AnimableObject: public Object3D, SceneGraph::Animable3D<> {
class AnimableObject: public Object3D, SceneGraph::Animable3D {
public:
AnimableObject(Object* parent = nullptr, SceneGraph::DrawableGroup3D<>* group = nullptr): Object3D(parent), SceneGraph::Animable3D<>(this, group) {
AnimableObject(Object* parent = nullptr, SceneGraph::DrawableGroup3D<>* group = nullptr): Object3D(parent), SceneGraph::Animable3D(this, group) {
setDuration(10.0f);
// ...
}
@ -90,22 +90,23 @@ class AnimableObject: public Object3D, SceneGraph::Animable3D<> {
@endcode
Then add the object to your scene and some animation group. You can also use
AnimableGroup::add() and AnimableGroup::remove() instead of passing the group
in the constructor. The animation is initially in stopped state and without
repeat, see setState(), setRepeated() and setRepeatCount() for more information.
BasicAnimableGroup::add() and BasicAnimableGroup::remove() instead of passing
the group in the constructor. The animation is initially in stopped state and
without repeat, see setState(), setRepeated() and setRepeatCount() for more
information.
@code
Scene3D scene;
SceneGraph::AnimableGroup3D<> animables;
SceneGraph::AnimableGroup3D animables;
(new AnimableObject(&scene, &animables))
->setState(SceneGraph::AnimationState::Running);
// ...
@endcode
Animation step is performed by calling AnimableGroup::step() in your draw event
implementation. The function expects absolute time from relative to some fixed
point in the past and time delta (i.e. duration of the frame). You can use
Timeline for that, see its documentation for more information.
Animation step is performed by calling BasicAnimableGroup::step() in your draw
event implementation. The function expects absolute time from relative to some
fixed point in the past and time delta (i.e. duration of the frame). You can
use Timeline for that, see its documentation for more information.
@code
Timeline timeline;
timeline.start();
@ -121,11 +122,11 @@ void MyApplication::drawEvent() {
@section Animable-performance Using animable groups to improve performance
AnimableGroup is optimized for case when no animation is running - it just
Animable group is optimized for case when no animation is running - it just
puts itself to rest and waits until some animation changes its state to
@ref AnimationState "AnimationState::Running" again. If you put animations
which are not pernamently running to separate group, they will not be always
traversed when calling AnimableGroup::step(), saving precious frame time.
traversed when calling BasicAnimableGroup::step(), saving precious frame time.
@section Animable-explicit-specializations Explicit template specializations
@ -134,18 +135,14 @@ For other specializations (e.g. using Double type) you have to use
Animable.hpp implementation file to avoid linker errors. See also
@ref compilation-speedup-hpp for more information.
- @ref Animable "Animable<2, Float>", @ref AnimableGroup "AnimableGroup<2, Float>"
- @ref Animable "Animable<3, Float>", @ref AnimableGroup "AnimableGroup<3, Float>"
- @ref BasicAnimable "BasicAnimable<2, Float>", @ref BasicAnimableGroup "BasicAnimableGroup<2, Float>"
- @ref BasicAnimable "BasicAnimable<3, Float>", @ref BasicAnimableGroup "BasicAnimableGroup<3, Float>"
@see @ref scenegraph, Animable2D, Animable3D, AnimableGroup2D, AnimableGroup3D
@see @ref Animable2D, @ref Animable3D, @ref scenegraph, @ref AnimableGroup2D,
@ref AnimableGroup3D
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
template<UnsignedInt dimensions, class T>
#else
template<UnsignedInt dimensions, class T = Float>
#endif
class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dimensions, Animable<dimensions, T>, T> {
friend class AnimableGroup<dimensions, T>;
template<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT BasicAnimable: public AbstractBasicGroupedFeature<dimensions, BasicAnimable<dimensions, T>, T> {
friend class BasicAnimableGroup<dimensions, T>;
public:
/**
@ -155,11 +152,11 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
*
* Creates stopped non-repeating animation with infinite duration,
* adds the feature to the object and also to group, if specified.
* @see setDuration(), setState(), setRepeated(), AnimableGroup::add()
* @see setDuration(), setState(), setRepeated(), BasicAnimableGroup::add()
*/
explicit Animable(AbstractObject<dimensions, T>* object, AnimableGroup<dimensions, T>* group = nullptr);
explicit BasicAnimable(AbstractObject<dimensions, T>* object, BasicAnimableGroup<dimensions, T>* group = nullptr);
~Animable();
~BasicAnimable();
/** @brief Animation duration */
Float duration() const { return _duration; }
@ -178,7 +175,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
* @see animationStarted(), animationPaused(), animationResumed(),
* animationStopped()
*/
Animable<dimensions, T>* setState(AnimationState state);
BasicAnimable<dimensions, T>* setState(AnimationState state);
/**
* @brief Whether the animation is repeated
@ -194,7 +191,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
* Default is `false`.
* @see setRepeatCount()
*/
Animable<dimensions, T>* setRepeated(bool repeated) {
BasicAnimable<dimensions, T>* setRepeated(bool repeated) {
_repeated = repeated;
return this;
}
@ -214,7 +211,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
* infinitely repeated animation. Default is `0`.
* @see setRepeated()
*/
Animable<dimensions, T>* setRepeatCount(UnsignedShort count) {
BasicAnimable<dimensions, T>* setRepeatCount(UnsignedShort count) {
_repeatCount = count;
return this;
}
@ -224,8 +221,8 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
*
* If the animable doesn't belong to any group, returns `nullptr`.
*/
AnimableGroup<dimensions, T>* group();
const AnimableGroup<dimensions, T>* group() const; /**< @overload */
BasicAnimableGroup<dimensions, T>* group();
const BasicAnimableGroup<dimensions, T>* group() const; /**< @overload */
protected:
/**
@ -236,7 +233,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
* infinite non-repeating animation. Default is `0.0f`.
*/
/* Protected so only animation implementer can change it */
Animable<dimensions, T>* setDuration(Float duration) {
BasicAnimable<dimensions, T>* setDuration(Float duration) {
_duration = duration;
return this;
}
@ -246,8 +243,8 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
* @param time Time from start of the animation
* @param delta Time delta for current frame
*
* This function is periodically called from AnimableGroup::step() if
* the animation state is set to @ref AnimationState "AnimationState::Running".
* This function is periodically called from BasicAnimableGroup::step()
* if the animation state is set to @ref AnimationState "AnimationState::Running".
* After animation duration is exceeded and repeat is not enabled or
* repeat count is exceeded, the animation state is set to
* @ref AnimationState "AnimationState::Stopped".
@ -265,7 +262,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
/**
* @brief Action on animation start
*
* Called from AnimableGroup::step() when state is changed from
* Called from BasicAnimableGroup::step() when state is changed from
* @ref AnimationState "AnimationState::Stopped" to
* @ref AnimationState "AnimationState::Running" and before first
* animationStep() is called.
@ -279,7 +276,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
/**
* @brief Action on animation pause
*
* Called from AnimableGroup::step() when state changes from
* Called from BasicAnimableGroup::step() when state changes from
* @ref AnimationState "AnimationState::Running" to
* @ref AnimationState "AnimationState::Paused" and after last
* animationStep() is called.
@ -293,7 +290,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
/**
* @brief Action on animation resume
*
* Called from AnimableGroup::step() when state changes from
* Called from BasicAnimableGroup::step() when state changes from
* @ref AnimationState "AnimationState::Paused" to
* @ref AnimationState "AnimationState::Running" and before first
* animationStep() is called.
@ -307,7 +304,7 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
/**
* @brief Action on animation stop
*
* Called from AnimableGroup::step() when state changes from either
* Called from BasicAnimableGroup::step() when state changes from either
* @ref AnimationState "AnimationState::Running" or
* @ref AnimationState "AnimationState::Paused" to
* @ref AnimationState "AnimationState::Stopped" and after last
@ -331,37 +328,19 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractBasicGroupedFeature<dime
UnsignedShort repeats;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Two-dimensional drawable
@brief Animable for two-dimensional float scenes
Convenience alternative to <tt>%Animable<2, T></tt>. See Animable for more
information.
@note Not available on GCC < 4.7. Use <tt>%Animable<2, T></tt> instead.
@see Animable3D
@see @ref Animable3D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class T = Float>
#else
template<class T>
#endif
using Animable2D = Animable<2, T>;
typedef BasicAnimable<2, Float> Animable2D;
/**
@brief Three-dimensional animable
@brief Animable for three-dimensional float scenes
Convenience alternative to <tt>%Animable<3, T></tt>. See Animable for more
information.
@note Not available on GCC < 4.7. Use <tt>%Animable<3, T></tt> instead.
@see Animable2D
@see @ref Animable2D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class T = Float>
#else
template<class T>
#endif
using Animable3D = Animable<3, T>;
#endif
typedef BasicAnimable<3, Float> Animable3D;
}}

22
src/SceneGraph/Animable.hpp

@ -35,11 +35,11 @@
namespace Magnum { namespace SceneGraph {
template<UnsignedInt dimensions, class T> Animable<dimensions, T>::Animable(AbstractObject<dimensions, T>* object, AnimableGroup<dimensions, T>* group): AbstractBasicGroupedFeature<dimensions, Animable<dimensions, T>, T>(object, group), _duration(0.0f), startTime(std::numeric_limits<Float>::infinity()), pauseTime(-std::numeric_limits<Float>::infinity()), previousState(AnimationState::Stopped), currentState(AnimationState::Stopped), _repeated(false), _repeatCount(0), repeats(0) {}
template<UnsignedInt dimensions, class T> BasicAnimable<dimensions, T>::BasicAnimable(AbstractObject<dimensions, T>* object, BasicAnimableGroup<dimensions, T>* group): AbstractBasicGroupedFeature<dimensions, BasicAnimable<dimensions, T>, T>(object, group), _duration(0.0f), startTime(std::numeric_limits<Float>::infinity()), pauseTime(-std::numeric_limits<Float>::infinity()), previousState(AnimationState::Stopped), currentState(AnimationState::Stopped), _repeated(false), _repeatCount(0), repeats(0) {}
template<UnsignedInt dimensions, class T> Animable<dimensions, T>::~Animable() {}
template<UnsignedInt dimensions, class T> BasicAnimable<dimensions, T>::~BasicAnimable() {}
template<UnsignedInt dimensions, class T> Animable<dimensions, T>* Animable<dimensions, T>::setState(AnimationState state) {
template<UnsignedInt dimensions, class T> BasicAnimable<dimensions, T>* BasicAnimable<dimensions, T>::setState(AnimationState state) {
if(currentState == state) return this;
/* Not allowed (for sanity) */
@ -52,20 +52,20 @@ template<UnsignedInt dimensions, class T> Animable<dimensions, T>* Animable<dime
return this;
}
template<UnsignedInt dimensions, class T> AnimableGroup<dimensions, T>* Animable<dimensions, T>::group() {
return static_cast<AnimableGroup<dimensions, T>*>(AbstractBasicGroupedFeature<dimensions, Animable<dimensions, T>, T>::group());
template<UnsignedInt dimensions, class T> BasicAnimableGroup<dimensions, T>* BasicAnimable<dimensions, T>::group() {
return static_cast<BasicAnimableGroup<dimensions, T>*>(AbstractBasicGroupedFeature<dimensions, BasicAnimable<dimensions, T>, T>::group());
}
template<UnsignedInt dimensions, class T> const AnimableGroup<dimensions, T>* Animable<dimensions, T>::group() const {
return static_cast<const AnimableGroup<dimensions, T>*>(AbstractBasicGroupedFeature<dimensions, Animable<dimensions, T>, T>::group());
template<UnsignedInt dimensions, class T> const BasicAnimableGroup<dimensions, T>* BasicAnimable<dimensions, T>::group() const {
return static_cast<const BasicAnimableGroup<dimensions, T>*>(AbstractBasicGroupedFeature<dimensions, BasicAnimable<dimensions, T>, T>::group());
}
template<UnsignedInt dimensions, class T> void AnimableGroup<dimensions, T>::step(const Float time, const Float delta) {
template<UnsignedInt dimensions, class T> void BasicAnimableGroup<dimensions, T>::step(const Float time, const Float delta) {
if(!_runningCount && !wakeUp) return;
wakeUp = false;
for(std::size_t i = 0; i != this->size(); ++i) {
Animable<dimensions, T>* animable = (*this)[i];
BasicAnimable<dimensions, T>* animable = (*this)[i];
/* The animation was stopped recently, just decrease count of running
animations if the animation was running before */
@ -126,9 +126,9 @@ template<UnsignedInt dimensions, class T> void AnimableGroup<dimensions, T>::ste
/* Animation is still running, perform animation step */
CORRADE_ASSERT(time-animable->startTime >= 0.0f,
"SceneGraph::AnimableGroup::step(): animation was started in future - probably wrong time passed", );
"SceneGraph::BasicAnimableGroup::step(): animation was started in future - probably wrong time passed", );
CORRADE_ASSERT(delta >= 0.0f,
"SceneGraph::AnimableGroup::step(): negative delta passed", );
"SceneGraph::BasicAnimableGroup::step(): negative delta passed", );
animable->animationStep(time - animable->startTime, delta);
}

47
src/SceneGraph/AnimableGroup.h

@ -25,7 +25,7 @@
*/
/** @file
* @brief Class Magnum::SceneGraph::AnimableGroup
* @brief Class Magnum::SceneGraph::BasicAnimableGroup, typedef Magnum::SceneGraph::AnimableGroup2D, Magnum::SceneGraph::AnimableGroup3D
*/
#include "FeatureGroup.h"
@ -37,22 +37,17 @@ namespace Magnum { namespace SceneGraph {
/**
@brief Group of animables
See Animable for more information.
@see @ref scenegraph, AnimableGroup2D, AnimableGroup3D
See BasicAnimable for more information.
@see @ref AnimableGroup2D, @ref AnimableGroup3D, @ref scenegraph
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
template<UnsignedInt dimensions, class T>
#else
template<UnsignedInt dimensions, class T = Float>
#endif
class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup: public BasicFeatureGroup<dimensions, Animable<dimensions, T>, T> {
friend class Animable<dimensions, T>;
template<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT BasicAnimableGroup: public BasicFeatureGroup<dimensions, BasicAnimable<dimensions, T>, T> {
friend class BasicAnimable<dimensions, T>;
public:
/**
* @brief Constructor
*/
explicit AnimableGroup(): _runningCount(0), wakeUp(false) {}
explicit BasicAnimableGroup(): _runningCount(0), wakeUp(false) {}
/**
* @brief Count of running animations
@ -76,37 +71,19 @@ class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup: public BasicFeatureGroup<dimension
bool wakeUp;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Two-dimensional drawable
@brief Animable group for two-dimensional float scenes
Convenience alternative to <tt>%AnimableGroup<2, T></tt>. See Animable for
more information.
@note Not available on GCC < 4.7. Use <tt>%AnimableGroup<2, T></tt> instead.
@see AnimableGroup3D
@see @ref AnimableGroup3D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class T = Float>
#else
template<class T>
#endif
using AnimableGroup2D = AnimableGroup<2, T>;
typedef BasicAnimableGroup<2, Float> AnimableGroup2D;
/**
@brief Three-dimensional animable
@brief Animable group for three-dimensional float scenes
Convenience alternative to <tt>%AnimableGroup<3, T></tt>. See Animable for
more information.
@note Not available on GCC < 4.7. Use <tt>%AnimableGroup<3, T></tt> instead.
@see AnimableGroup2D
@see @ref AnimableGroup2D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class T = Float>
#else
template<class T>
#endif
using AnimableGroup3D = AnimableGroup<3, T>;
#endif
typedef BasicAnimableGroup<3, Float> AnimableGroup3D;
}}

16
src/SceneGraph/SceneGraph.h

@ -77,19 +77,15 @@ template<class T = Float> class AbstractTranslationRotation3D;
template<class T = Float> class AbstractTranslationRotationScaling2D;
template<class T = Float> class AbstractTranslationRotationScaling3D;
template<UnsignedInt dimensions, class T = Float> class Animable;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T = Float> using Animable2D = Animable<2, T>;
template<class T = Float> using Animable3D = Animable<3, T>;
#endif
template<UnsignedInt, class> class BasicAnimable;
typedef BasicAnimable<2, Float> Animable2D;
typedef BasicAnimable<3, Float> Animable3D;
enum class AnimationState: UnsignedByte;
template<UnsignedInt dimensions, class T = Float> class AnimableGroup;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T = Float> using AnimableGroup2D = AnimableGroup<2, T>;
template<class T = Float> using AnimableGroup3D = AnimableGroup<3, T>;
#endif
template<UnsignedInt, class> class BasicAnimableGroup;
typedef BasicAnimableGroup<2, Float> AnimableGroup2D;
typedef BasicAnimableGroup<3, Float> AnimableGroup3D;
template<class> class BasicCamera2D;
template<class> class BasicCamera3D;

28
src/SceneGraph/Test/AnimableTest.cpp

@ -59,9 +59,9 @@ AnimableTest::AnimableTest() {
}
void AnimableTest::state() {
class StateTrackingAnimable: public SceneGraph::Animable<3> {
class StateTrackingAnimable: public SceneGraph::Animable3D {
public:
StateTrackingAnimable(AbstractObject<3>* object, AnimableGroup<3>* group = nullptr): SceneGraph::Animable<3>(object, group) {
StateTrackingAnimable(AbstractObject<3>* object, AnimableGroup3D* group = nullptr): SceneGraph::Animable3D(object, group) {
setDuration(1.0f);
}
@ -77,7 +77,7 @@ void AnimableTest::state() {
};
Object3D object;
AnimableGroup<3> group;
AnimableGroup3D group;
CORRADE_COMPARE(group.runningCount(), 0);
/* Verify initial state */
@ -149,9 +149,9 @@ void AnimableTest::state() {
CORRADE_COMPARE(group.runningCount(), 2);
}
class OneShotAnimable: public SceneGraph::Animable<3> {
class OneShotAnimable: public SceneGraph::Animable3D {
public:
OneShotAnimable(AbstractObject<3>* object, AnimableGroup<3>* group = nullptr): SceneGraph::Animable<3>(object, group), time(-1.0f) {
OneShotAnimable(AbstractObject<3>* object, AnimableGroup3D* group = nullptr): SceneGraph::Animable3D(object, group), time(-1.0f) {
setDuration(10.0f);
setState(AnimationState::Running);
}
@ -174,9 +174,9 @@ class OneShotAnimable: public SceneGraph::Animable<3> {
};
void AnimableTest::step() {
class InifiniteAnimable: public SceneGraph::Animable<3> {
class InifiniteAnimable: public SceneGraph::Animable3D {
public:
InifiniteAnimable(AbstractObject<3>* object, AnimableGroup<3>* group = nullptr): SceneGraph::Animable<3>(object, group), time(-1.0f), delta(0.0f) {}
InifiniteAnimable(AbstractObject<3>* object, AnimableGroup3D* group = nullptr): SceneGraph::Animable3D(object, group), time(-1.0f), delta(0.0f) {}
Float time, delta;
@ -188,7 +188,7 @@ void AnimableTest::step() {
};
Object3D object;
AnimableGroup<3> group;
AnimableGroup3D group;
InifiniteAnimable animable(&object, &group);
/* Calling step() if no object is running should do nothing */
@ -213,7 +213,7 @@ void AnimableTest::step() {
void AnimableTest::duration() {
Object3D object;
AnimableGroup<3> group;
AnimableGroup3D group;
OneShotAnimable animable(&object, &group);
CORRADE_VERIFY(!animable.isRepeated());
@ -233,9 +233,9 @@ void AnimableTest::duration() {
}
void AnimableTest::repeat() {
class RepeatingAnimable: public SceneGraph::Animable<3> {
class RepeatingAnimable: public SceneGraph::Animable3D {
public:
RepeatingAnimable(AbstractObject<3>* object, AnimableGroup<3>* group = nullptr): SceneGraph::Animable<3>(object, group), time(-1.0f) {
RepeatingAnimable(AbstractObject<3>* object, AnimableGroup3D* group = nullptr): SceneGraph::Animable3D(object, group), time(-1.0f) {
setDuration(10.0f);
setState(AnimationState::Running);
setRepeated(true);
@ -250,7 +250,7 @@ void AnimableTest::repeat() {
};
Object3D object;
AnimableGroup<3> group;
AnimableGroup3D group;
RepeatingAnimable animable(&object, &group);
CORRADE_COMPARE(animable.repeatCount(), 0);
@ -295,7 +295,7 @@ void AnimableTest::repeat() {
void AnimableTest::stop() {
Object3D object;
AnimableGroup<3> group;
AnimableGroup3D group;
OneShotAnimable animable(&object, &group);
CORRADE_COMPARE(animable.repeatCount(), 0);
@ -320,7 +320,7 @@ void AnimableTest::stop() {
void AnimableTest::pause() {
Object3D object;
AnimableGroup<3> group;
AnimableGroup3D group;
OneShotAnimable animable(&object, &group);
/* First two steps, animation is running */

Loading…
Cancel
Save