-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyframeNode.hpp
More file actions
38 lines (26 loc) · 796 Bytes
/
KeyframeNode.hpp
File metadata and controls
38 lines (26 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "SceneNode.hpp"
#include <functional>
typedef std::function<double(double)> EasingFunction;
class KeyframeNode : public SceneNode
{
public:
KeyframeNode(const std::string & name, double startTime, double endTime, uint easing);
virtual ~KeyframeNode();
// void setStartTime(double t);
// void setEndTime(double t);
// void setEasing(uint index);
// const glm::mat4& get_transform(double t) const;
void rotate(char axis, float angle) override;
void scale(const glm::vec3& amount) override;
void translate(const glm::vec3& amount) override;
void updateTrans(double time) override;
private:
double m_startTime;
double m_endTime;
EasingFunction m_easing;
double m_currentTime;
glm::dvec3 m_translation;
glm::dvec3 m_rotation;
glm::dvec3 m_scale;
};