mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
49 lines
967 B
C++
49 lines
967 B
C++
#ifndef KEYFRAME_CHANNEL_H
|
|
#define KEYFRAME_CHANNEL_H
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
namespace vb01{
|
|
class Animatable;
|
|
|
|
struct KeyframeChannel{
|
|
enum Type{
|
|
POS_X,
|
|
POS_Y,
|
|
POS_Z,
|
|
ROT_W,
|
|
ROT_X,
|
|
ROT_Y,
|
|
ROT_Z,
|
|
SCALE_X,
|
|
SCALE_Y,
|
|
SCALE_Z,
|
|
SHAPE_KEY_MIN,
|
|
SHAPE_KEY_VALUE,
|
|
SHAPE_KEY_MAX
|
|
};
|
|
struct Keyframe{
|
|
enum Interpolation{CONSTANT, LINEAR, BEZIER};
|
|
|
|
float value, frame;
|
|
Interpolation interpolation;
|
|
};
|
|
|
|
Type type;
|
|
Animatable *animatable = nullptr;
|
|
std::vector<Keyframe> keyframes;
|
|
|
|
static KeyframeChannel::Type getKeyframeChannelType(std::string);
|
|
static float interpolate(float, float, Keyframe::Interpolation, float);
|
|
static Keyframe findKeyframe(float, KeyframeChannel, bool);
|
|
static void transform();
|
|
};
|
|
|
|
typedef KeyframeChannel::Type KeyframeChannelType;
|
|
typedef KeyframeChannel::Keyframe Keyframe;
|
|
typedef KeyframeChannel::Keyframe::Interpolation KeyframeInterpolation;
|
|
}
|
|
|
|
#endif
|