wavelength 1.0.0
Loading...
Searching...
No Matches
animatetoaction.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
6#include "math/interpolator.h"
7#include "rnd/rndanimatable.h"
8#include "script/dataarray.h"
9
19public:
27 explicit AnimateToAction(DataArray *pAction);
28
35 ~AnimateToAction() override;
36
43 void Exec() override;
44
52 bool Poll() override;
53
54private:
55 // The values of node 4.
56 enum Curve {
57 kCurveLinear = 0,
58 kCurveInvExp = 1,
59 kCurveATan = 2,
60 };
61
62 RndAnimatable *mAnim;
63 float mTarget;
64 float mDuration;
65 std::unique_ptr<Interpolator> mCurve;
66 int mLoops;
67 float mLoopLength;
68 float mEndTime;
69};
~AnimateToAction() override
Delete the curve.
void Exec() override
Fit the curve from the current frame and start the move.
bool Poll() override
Move the animatable to the frame of the curve for the time on the clock.
AnimateToAction(DataArray *pAction)
Read the action.
Reference-counted array of script data nodes.
Definition dataarray.h:20
Mix-in for an object driven by a frame.
Definition rndanimatable.h:16
Something a trigger does when its conditions hold.
Definition triggeraction.h:15