diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2019-06-12 00:57:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-12 00:57:49 +0200 |
commit | 0f402c97ea94c3980aa7aa0305a35db1a3f59c2b (patch) | |
tree | 1d9bb0ba737fcd4ba0189c72ecd651eddbe04ac4 /src/animation/AnimBlendClumpData.h | |
parent | tmp (diff) | |
parent | added animation system (with skin support for now) (diff) | |
download | re3-0f402c97ea94c3980aa7aa0305a35db1a3f59c2b.tar re3-0f402c97ea94c3980aa7aa0305a35db1a3f59c2b.tar.gz re3-0f402c97ea94c3980aa7aa0305a35db1a3f59c2b.tar.bz2 re3-0f402c97ea94c3980aa7aa0305a35db1a3f59c2b.tar.lz re3-0f402c97ea94c3980aa7aa0305a35db1a3f59c2b.tar.xz re3-0f402c97ea94c3980aa7aa0305a35db1a3f59c2b.tar.zst re3-0f402c97ea94c3980aa7aa0305a35db1a3f59c2b.zip |
Diffstat (limited to 'src/animation/AnimBlendClumpData.h')
-rw-r--r-- | src/animation/AnimBlendClumpData.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/animation/AnimBlendClumpData.h b/src/animation/AnimBlendClumpData.h new file mode 100644 index 00000000..955578f0 --- /dev/null +++ b/src/animation/AnimBlendClumpData.h @@ -0,0 +1,57 @@ +#pragma once + +#include "AnimBlendList.h" + + +// TODO: put somewhere else +struct AnimBlendFrameData +{ + enum { + IGNORE_ROTATION = 2, + IGNORE_TRANSLATION = 4, + VELOCITY_EXTRACTION = 8, + VELOCITY_EXTRACTION_3D = 0x10, + }; + + uint8 flag; + RwV3d resetPos; +#ifdef PED_SKIN + union { + RwFrame *frame; + RpHAnimStdKeyFrame *hanimframe; + }; + int32 nodeID; +#else + RwFrame *frame; +#endif +}; +#ifndef PED_SKIN +static_assert(sizeof(AnimBlendFrameData) == 0x14, "AnimBlendFrameData: error"); +#endif + + +class CAnimBlendClumpData +{ +public: + CAnimBlendLink link; + int32 numFrames; +#ifdef PED_SKIN + int32 modelNumber; // doesn't seem to be used +#endif + CVector *pedPosition; + // order of frames is determined by RW hierarchy + AnimBlendFrameData *frames; + + CAnimBlendClumpData(void); + ~CAnimBlendClumpData(void); + void SetNumberOfFrames(int n); +#ifdef PED_SKIN + void SetNumberOfBones(int n) { SetNumberOfFrames(n); } +#endif + void ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *arg); + + + CAnimBlendClumpData *ctor(void) { return ::new (this) CAnimBlendClumpData(); } + void dtor(void) { this->CAnimBlendClumpData::~CAnimBlendClumpData(); } +}; +static_assert(sizeof(CAnimBlendClumpData) == 0x14, "CAnimBlendClumpData: error"); |