2019-06-11 02:59:28 -04:00
|
|
|
#pragma once
|
|
|
|
|
2019-07-08 15:44:32 -04:00
|
|
|
#include "Quaternion.h"
|
2019-06-11 02:59:28 -04:00
|
|
|
|
|
|
|
// TODO: put them somewhere else?
|
|
|
|
struct KeyFrame {
|
|
|
|
CQuaternion rotation;
|
|
|
|
float deltaTime; // relative to previous key frame
|
|
|
|
};
|
|
|
|
|
|
|
|
struct KeyFrameTrans : KeyFrame {
|
|
|
|
CVector translation;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// The sequence of key frames of one animated node
|
|
|
|
class CAnimBlendSequence
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
KF_ROT = 1,
|
|
|
|
KF_TRANS = 2
|
|
|
|
};
|
|
|
|
int32 type;
|
|
|
|
char name[24];
|
|
|
|
int32 numFrames;
|
|
|
|
#ifdef PED_SKIN
|
|
|
|
int16 boneTag;
|
|
|
|
#endif
|
|
|
|
void *keyFrames;
|
|
|
|
void *keyFramesCompressed;
|
|
|
|
|
|
|
|
CAnimBlendSequence(void);
|
|
|
|
virtual ~CAnimBlendSequence(void);
|
|
|
|
void SetName(char *name);
|
|
|
|
void SetNumFrames(int numFrames, bool translation);
|
|
|
|
void RemoveQuaternionFlips(void);
|
|
|
|
KeyFrame *GetKeyFrame(int n) {
|
|
|
|
return type & KF_TRANS ?
|
|
|
|
&((KeyFrameTrans*)keyFrames)[n] :
|
|
|
|
&((KeyFrame*)keyFrames)[n];
|
|
|
|
}
|
|
|
|
bool HasTranslation(void) { return !!(type & KF_TRANS); }
|
|
|
|
// TODO? these are unused
|
|
|
|
// void Uncompress(void);
|
|
|
|
// void CompressKeyframes(void);
|
|
|
|
// void RemoveUncompressedData(void);
|
|
|
|
|
|
|
|
#ifdef PED_SKIN
|
|
|
|
void SetBoneTag(int tag) { boneTag = tag; }
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
#ifndef PED_SKIN
|
|
|
|
static_assert(sizeof(CAnimBlendSequence) == 0x2C, "CAnimBlendSequence: error");
|
|
|
|
#endif
|