2020-04-15 12:05:24 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-04-23 20:25:18 +00:00
|
|
|
#include "rtquat.h"
|
|
|
|
|
2020-04-15 12:05:24 +00:00
|
|
|
//struct RpHAnimHierarchy;
|
|
|
|
typedef rw::HAnimHierarchy RpHAnimHierarchy;
|
|
|
|
//struct RpHAnimAnimation;
|
|
|
|
typedef rw::Animation RpHAnimAnimation;
|
|
|
|
|
2020-04-23 20:25:18 +00:00
|
|
|
#define rpHANIMSTDKEYFRAMETYPEID 0x1
|
|
|
|
|
2020-04-25 13:56:20 +00:00
|
|
|
// same as rw::HAnimKeyFrame, but we need RtQuat in this one
|
|
|
|
struct RpHAnimStdKeyFrame
|
|
|
|
{
|
|
|
|
RpHAnimStdKeyFrame *prevFrame;
|
|
|
|
RwReal time;
|
|
|
|
RtQuat q;
|
|
|
|
RwV3d t;
|
|
|
|
};
|
|
|
|
|
2020-04-23 20:25:18 +00:00
|
|
|
|
|
|
|
enum RpHAnimHierarchyFlag
|
|
|
|
{
|
|
|
|
rpHANIMHIERARCHYSUBHIERARCHY = rw::HAnimHierarchy::SUBHIERARCHY,
|
|
|
|
rpHANIMHIERARCHYNOMATRICES = rw::HAnimHierarchy::NOMATRICES,
|
|
|
|
|
|
|
|
rpHANIMHIERARCHYUPDATEMODELLINGMATRICES = rw::HAnimHierarchy::UPDATEMODELLINGMATRICES,
|
|
|
|
rpHANIMHIERARCHYUPDATELTMS = rw::HAnimHierarchy::UPDATELTMS,
|
|
|
|
rpHANIMHIERARCHYLOCALSPACEMATRICES = rw::HAnimHierarchy::LOCALSPACEMATRICES
|
|
|
|
};
|
|
|
|
|
|
|
|
#define rpHANIMPOPPARENTMATRIX rw::HAnimHierarchy::POP
|
|
|
|
#define rpHANIMPUSHPARENTMATRIX rw::HAnimHierarchy::PUSH
|
|
|
|
|
2020-04-15 12:05:24 +00:00
|
|
|
RwBool RpHAnimPluginAttach(void);
|
|
|
|
|
2020-04-23 20:25:18 +00:00
|
|
|
RwBool RpHAnimFrameSetID(RwFrame *frame, RwInt32 id);
|
|
|
|
RwInt32 RpHAnimFrameGetID(RwFrame *frame);
|
|
|
|
|
|
|
|
RwInt32 RpHAnimIDGetIndex(RpHAnimHierarchy *hierarchy, RwInt32 ID);
|
|
|
|
|
2020-04-15 12:05:24 +00:00
|
|
|
RwBool RpHAnimFrameSetHierarchy(RwFrame *frame, RpHAnimHierarchy *hierarchy);
|
|
|
|
RpHAnimHierarchy *RpHAnimFrameGetHierarchy(RwFrame *frame);
|
|
|
|
|
2020-04-23 20:25:18 +00:00
|
|
|
RpHAnimHierarchy *RpHAnimHierarchySetFlags(RpHAnimHierarchy *hierarchy, RpHAnimHierarchyFlag flags);
|
|
|
|
RpHAnimHierarchyFlag RpHAnimHierarchyGetFlags(RpHAnimHierarchy *hierarchy);
|
|
|
|
|
2020-04-15 12:05:24 +00:00
|
|
|
RwBool RpHAnimHierarchySetCurrentAnim(RpHAnimHierarchy *hierarchy, RpHAnimAnimation *anim);
|
|
|
|
RwBool RpHAnimHierarchySetCurrentAnimTime(RpHAnimHierarchy *hierarchy, RwReal time);
|
|
|
|
RwBool RpHAnimHierarchySubAnimTime(RpHAnimHierarchy *hierarchy, RwReal time);
|
|
|
|
RwBool RpHAnimHierarchyAddAnimTime(RpHAnimHierarchy *hierarchy, RwReal time);
|
|
|
|
|
2020-04-23 20:25:18 +00:00
|
|
|
RwMatrix *RpHAnimHierarchyGetMatrixArray(RpHAnimHierarchy *hierarchy);
|
2020-04-15 12:05:24 +00:00
|
|
|
RwBool RpHAnimHierarchyUpdateMatrices(RpHAnimHierarchy *hierarchy);
|
|
|
|
|
2020-04-23 20:25:18 +00:00
|
|
|
#define rpHANIMHIERARCHYGETINTERPFRAME( hierarchy, nodeIndex ) \
|
|
|
|
( (void *)( ( (RwUInt8 *)&(hierarchy->interpolator[1]) + \
|
|
|
|
((nodeIndex) * \
|
|
|
|
hierarchy->interpolator->currentAnimKeyFrameSize) ) ) )
|
|
|
|
|
|
|
|
|
|
|
|
RpHAnimAnimation *RpHAnimAnimationCreate(RwInt32 typeID, RwInt32 numFrames, RwInt32 flags, RwReal duration);
|
|
|
|
RpHAnimAnimation *RpHAnimAnimationDestroy(RpHAnimAnimation *animation);
|
2020-04-15 12:05:24 +00:00
|
|
|
RpHAnimAnimation *RpHAnimAnimationStreamRead(RwStream *stream);
|