3#include <animation/SRotateAnimation.h>
16 mPivotX = (float)
resolveSize(mPivotXDesc, width, parentWidth, nScale);
17 mPivotY = (float)
resolveSize(mPivotYDesc, height, parentHeight, nScale);
22 float degrees = mFromDegrees + ((mToDegrees - mFromDegrees) * interpolatedTime);
25 if (mPivotX == 0.0f && mPivotY == 0.0f)
27 t->GetMatrix()->setRotate(degrees);
31 t->GetMatrix()->setRotate2(degrees, mPivotX * scale, mPivotY * scale);
33 t->SetTransformationType(TYPE_MATRIX);
42 mFromDegrees = src2->mFromDegrees;
43 mToDegrees = src2->mToDegrees;
44 mPivotXDesc = src2->mPivotXDesc;
45 mPivotYDesc = src2->mPivotYDesc;
50 mFromDegrees = fromDegrees;
51 mToDegrees = toDegrees;
int resolveSize(const SValueDescription &value, int size, int parentSize, int nScale)
Converts the information in the description of a size to an actual dimension.
void copy(const IAnimation *src) OVERRIDE
Copies the properties of another animation to this animation.
float getScaleFactor()
Gets the scale factor that should be applied to pre-scaled values in an Animation....
void applyTransformation(float interpolatedTime, ITransformation *t) OVERRIDE
Applies the transformation at a specific interpolated time.
void init(float fromDegrees, float toDegrees, const SValueDescription &pivotX, const SValueDescription &pivotY)
Constructor to use when building a RotateAnimation from code.
void copy(const IAnimation *src) OVERRIDE
Copies the properties of another animation to this animation.
void initialize(int width, int height, int parentWidth, int parentHeight, int nScale) OVERRIDE
Initializes the animation with the dimensions of the object and its parent.
SRotateAnimation()
Default constructor for SRotateAnimation. Default pivotX/pivotY point is (0,0).
Utility class to parse a string description of a size.