2021-09-13 15:53:43 +03:00
|
|
|
//
|
|
|
|
// Created by Иван Ильин on 29.01.2021.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ENGINE_AROTATE_H
|
|
|
|
#define ENGINE_AROTATE_H
|
|
|
|
|
|
|
|
#include "Animation.h"
|
2021-10-09 13:41:12 +03:00
|
|
|
#include "../Object.h"
|
2021-09-13 15:53:43 +03:00
|
|
|
|
2021-10-12 20:18:56 +03:00
|
|
|
class ARotate final : public Animation {
|
2021-09-13 15:53:43 +03:00
|
|
|
private:
|
2021-10-02 20:36:07 +03:00
|
|
|
std::shared_ptr<Object> _object;
|
|
|
|
|
2021-10-12 17:12:47 +03:00
|
|
|
Vec3D value;
|
2021-09-13 15:53:43 +03:00
|
|
|
public:
|
2021-10-12 17:12:47 +03:00
|
|
|
ARotate(std::shared_ptr<Object> object, const Vec3D& r, double duration = 1, LoopOut looped = LoopOut::None, InterpolationType interpolationType = InterpolationType::bezier) : value(r) {
|
2021-10-02 20:36:07 +03:00
|
|
|
_object = object;
|
2021-09-13 15:53:43 +03:00
|
|
|
_duration = duration;
|
|
|
|
_looped = looped;
|
|
|
|
_intType = interpolationType;
|
|
|
|
}
|
|
|
|
|
2021-10-02 20:36:07 +03:00
|
|
|
bool update() override {
|
|
|
|
_object->rotate(value * _dp);
|
2021-09-13 15:53:43 +03:00
|
|
|
return updateState();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //INC_3DZAVR_AROTATE_H
|