#pragma once #include #include #include #include #include #include namespace xanim { enum class CompiledXAnimVersion : uint8_t { // IW3 VERSION_17 = 17 }; enum class QuatType : uint8_t { NO_QUAT = 0, HALF_QUAT = 1, FULL_QUAT = 2, HALF_QUAT_NO_SIZE = 3, FULL_QUAT_NO_SIZE = 4, }; enum class TransType : uint8_t { SMALL_TRANS = 5, FULL_TRANS = 6, TRANS_NO_SIZE = 7, NO_TRANS = 8, }; struct CommonXQuat { int16_t value[4]; }; struct CommonXQuat2 { int16_t value[2]; }; struct CommonVec3U8 { uint8_t value[3]; }; struct CommonVec3U16 { uint16_t value[3]; }; class QuatTrack { public: QuatTrack(); QuatType m_type; std::vector m_indices; std::vector m_frames; std::vector m_frames2; }; class TransTrack { public: TransTrack(); TransType m_type; std::vector m_indices; std::array m_mins; std::array m_size; std::vector m_byte_frames; std::vector m_short_frames; std::array m_constant; }; class BoneTrack { public: BoneTrack() = default; std::string m_name; QuatTrack m_quat; TransTrack m_trans; }; class CommonXAnimNotifyInfo { public: CommonXAnimNotifyInfo(); CommonXAnimNotifyInfo(std::string name, float time); std::string m_name; float m_time; }; class CommonDeltaQuatTrack { public: CommonDeltaQuatTrack() = default; std::vector m_indices; std::vector m_frames2; }; class CommonDeltaTransTrack { public: CommonDeltaTransTrack(); std::optional> m_constant; bool m_small_trans; std::vector m_indices; std::array m_mins; std::array m_size; std::vector m_frames_u8; std::vector m_frames_u16; }; class CommonXAnimDeltaTrack { public: CommonXAnimDeltaTrack() = default; std::optional m_quat; std::optional m_trans; }; class CommonXAnimParts { public: CommonXAnimParts(); void SortBoneTracksForQuats(); [[nodiscard]] std::vector GetBoneTrackOrderForTrans() const; size_t m_num_frames; bool m_looped; float m_frame_rate; uint8_t m_asset_type; std::vector m_bone_tracks; std::vector m_notifies; std::unique_ptr m_delta_track; }; [[nodiscard]] std::string GetCompiledFileNameForAssetName(const std::string& assetName); } // namespace xanim