2022-12-27 17:54:39 -06:00
|
|
|
#ifndef ANIM_H
|
|
|
|
#define ANIM_H
|
|
|
|
|
2023-12-04 13:38:37 -06:00
|
|
|
#include "HandmadeMath.h"
|
|
|
|
|
2022-12-27 17:54:39 -06:00
|
|
|
struct keyframe {
|
2023-05-12 13:22:05 -05:00
|
|
|
double time;
|
|
|
|
double val;
|
2022-12-27 17:54:39 -06:00
|
|
|
};
|
|
|
|
|
2023-12-04 13:38:37 -06:00
|
|
|
#define LINEAR 0
|
|
|
|
#define STEP 1
|
|
|
|
#define CUBICSPLINE 2
|
|
|
|
|
|
|
|
typedef struct sampler {
|
|
|
|
float *times;
|
|
|
|
HMM_Vec4 *data;
|
|
|
|
int type;
|
|
|
|
int rotation;
|
|
|
|
} sampler;
|
|
|
|
|
|
|
|
struct anim_channel {
|
|
|
|
sampler *sampler;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct animation {
|
|
|
|
char *name;
|
|
|
|
double time;
|
|
|
|
struct anim_channel *channels;
|
2022-12-27 17:54:39 -06:00
|
|
|
};
|
|
|
|
|
2023-12-04 13:38:37 -06:00
|
|
|
HMM_Vec4 sample_sampler(sampler *sampler, float time);
|
2022-12-27 17:54:39 -06:00
|
|
|
|
2023-12-04 13:38:37 -06:00
|
|
|
#endif
|