Generalize easing system (works for all components now)
This commit is contained in:
@@ -111,20 +111,13 @@ typedef struct Animation {
|
||||
} Animation;
|
||||
extern ECS_COMPONENT_DECLARE(Animation);
|
||||
|
||||
typedef enum EasingType {
|
||||
EASE_ROTATION,
|
||||
EASE_POS_X,
|
||||
EASE_POS_Y,
|
||||
EASE_SIZE_X,
|
||||
EASE_SIZE_Y,
|
||||
} EasingType;
|
||||
|
||||
typedef struct Easing {
|
||||
EasingType type;
|
||||
ecs_entity_t compID;
|
||||
size_t memberOffset;
|
||||
|
||||
BzEaseType easingFunc;
|
||||
|
||||
// start + target * (easeStart + (easeTarget * x) + easeOffset) + offset
|
||||
|
||||
f32 target;
|
||||
f32 start;
|
||||
f32 offset;
|
||||
@@ -135,7 +128,6 @@ typedef struct Easing {
|
||||
f32 x;
|
||||
f32 elapsed;
|
||||
f32 duration;
|
||||
|
||||
//struct Easing *next;
|
||||
} Easing;
|
||||
extern ECS_COMPONENT_DECLARE(Easing);
|
||||
|
||||
Reference in New Issue
Block a user