blob: 4dce3b1383e28df64c5ed5c75f9e4079b88823ab (
plain) (
blame)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#pragma once
#include "Quaternion.h"
// 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;
int16 boneTag;
void *keyFrames;
void *keyFramesCompressed;
CAnimBlendSequence(void);
virtual ~CAnimBlendSequence(void);
void SetName(char *name);
void SetNumFrames(int numFrames, bool translation, bool compressed);
void RemoveQuaternionFlips(void);
KeyFrame *GetKeyFrame(int n) {
return type & KF_TRANS ?
&((KeyFrameTrans*)keyFrames)[n] :
&((KeyFrame*)keyFrames)[n];
}
KeyFrame *GetKeyFrameCompressed(int n) {
return type & KF_TRANS ?
&((KeyFrameTrans*)keyFramesCompressed)[n] :
&((KeyFrame*)keyFramesCompressed)[n];
}
bool HasTranslation(void) { return !!(type & KF_TRANS); }
// TODO? these are unused
// void Uncompress(void);
// void CompressKeyframes(void);
// void RemoveUncompressedData(void);
void SetBoneTag(int tag) { boneTag = tag; }
};
VALIDATE_SIZE(CAnimBlendSequence, 0x30);
|