summaryrefslogblamecommitdiffstats
path: root/src/animation/AnimBlendClumpData.h
blob: 10652d4aa4996f9f562b72bb25bfdb1c06adbab1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                              
                                        






                               
                                               















                                                                               
                          









                                                                             
  
#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,
		UPDATE_KEYFRAMES = 0x20,
	};

	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;
	CVector *velocity;
	// 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);
};