#ifndef CANIMATION_H #define CANIMATION_H #include "CResource.h" #include #include #include class CAnimation : public CResource { DECLARE_RESOURCE_TYPE(eAnimation) friend class CAnimationLoader; typedef std::vector TScaleChannel; typedef std::vector TRotationChannel; typedef std::vector TTranslationChannel; float mDuration; float mTickInterval; u32 mNumKeys; std::vector mScaleChannels; std::vector mRotationChannels; std::vector mTranslationChannels; struct SBoneChannelInfo { u8 ScaleChannelIdx; u8 RotationChannelIdx; u8 TranslationChannelIdx; }; SBoneChannelInfo mBoneInfo[100]; public: CAnimation(); void EvaluateTransform(float Time, u32 BoneID, CVector3f *pOutTranslation, CQuaternion *pOutRotation, CVector3f *pOutScale) const; bool HasTranslation(u32 BoneID) const; inline float Duration() const { return mDuration; } inline u32 NumKeys() const { return mNumKeys; } inline float TickInterval() const { return mTickInterval; } }; #endif // CANIMATION_H