summaryrefslogtreecommitdiffstats
path: root/src/animation/AnimBlendSequence.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-11 08:59:28 +0200
committeraap <aap@papnet.eu>2019-06-11 08:59:28 +0200
commite7ed4d009636804d5dbe05aae9e7ab23b80fdd37 (patch)
tree4c95f6e07923b5ed0a7046afeb42a1ea2b8693bf /src/animation/AnimBlendSequence.h
parentMerge branch 'master' of github.com:GTAmodding/re3 (diff)
downloadre3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar
re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.gz
re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.bz2
re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.lz
re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.xz
re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.zst
re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.zip
Diffstat (limited to '')
-rw-r--r--src/animation/AnimBlendSequence.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/animation/AnimBlendSequence.h b/src/animation/AnimBlendSequence.h
new file mode 100644
index 00000000..7538cf56
--- /dev/null
+++ b/src/animation/AnimBlendSequence.h
@@ -0,0 +1,55 @@
+#pragma once
+
+#include "math/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;
+#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