138 bool move_with_root =
false);
140AnimationContainer
Convert(std::vector<SAnimation>&& sanimations,
const std::vector<ConvertParam>& anim_params,
141 bool move_with_root =
false);
156bool IsOfType(
const std::filesystem::path& path);
248 u16 num_animations = 0;
249 u16 num_bones_per_animation = 0;
250 u16 move_with_root = 0;
252 u32 offset_duration_table = 0;
253 u32 offset_keyframe_table = 0;
254 u32 offset_rotation_table = 0;
255 u32 offset_scale_traslation_table = 0;
258static_assert(
sizeof(RHeader) == 0x1C);
261 u32 index_keyframe_scale = 0;
262 u32 index_keyframe_translation = 0;
263 u32 index_keyframe_rotation = 0;
264 u32 index_scale_table = 0;
265 u32 index_rotation_table = 0;
266 u32 index_translation_table = 0;
267 u16 num_scale_transforms = 0;
268 u16 num_rotation_transforms = 0;
269 u16 num_translation_transforms = 0;
273static_assert(
sizeof(RBoneAnimation) == 0x20);
275struct RAnimationContainer {
277 std::vector<RBoneAnimation> bone_animations;
278 std::vector<Vec3<f32>> scale_translation_table;
279 std::vector<Vec3<i16>> rotation_table;
280 std::vector<u16> keyframe_table;
281 std::vector<u16> duration_table;
284AnimationContainer Convert(
const RAnimationContainer& ranimation_container);
286RAnimationContainer Parse(Reader& f);
Contains macros and definitions for fixed-width types.
std::vector< KeyFrame > rotation_keys
Rotation keys.
Definition animation.hpp:62
std::vector< Animation > animations
Collection of animations.
Definition animation.hpp:95
bool move_with_root
Definition animation.hpp:93
std::vector< KeyFrame > scale_keys
Scale keys.
Definition animation.hpp:61
bool unbake
Remove keyframes that are duplicate or can be derived via interpolation.
Definition animation.hpp:121
std::vector< BoneAnimation > animation_channels
Definition animation.hpp:73
std::vector< KeyFrame > translation_keys
Translation keys.
Definition animation.hpp:63
u16 time_tick
Definition animation.hpp:44
glm::vec3 value
Definition animation.hpp:47
u16 duration_ticks
Definition animation.hpp:71
Holds a collection of skeletal animations.
Definition animation.hpp:92
Represents a keyframe in an animation.
Definition animation.hpp:43
Parameters for converting animations to the in-game format.
Definition animation.hpp:120
Represents the transformations of a bone during an animation.
Definition animation.hpp:60
Represents a single skeletal animation.
Definition animation.hpp:70
std::vector< SAnimation > Convert(const AnimationContainer &animations)
Converts multiple in-game animations to a simpler format.
bool IsOfType(BufferView buffer)
Tests if the provided file is an animation container.
Buffer Export(const AnimationContainer &animation_container)
Exports animations to a binary file format.
AnimationContainer Import(BufferView buffer)
Imports animations from a binary file.
constexpr u32 kMagicBytes
Magic bytes used to identify the animation format.
Definition animation.hpp:244
std::uint16_t u16
16-bit unsigned integer
Definition fixed_type.hpp:62
std::uint32_t u32
32-bit unsigned integer
Definition fixed_type.hpp:60
#define NNL_PACK(...)
A structure packing directive.
Definition fixed_type.hpp:41
Represents a skeletal animation.
Definition sanimation.hpp:97
Provides classes for reading and writing binary data to and from various sources.
Contains functions and structures for working with in-game skeletal animations.
Definition animation.hpp:30
Definition exception.hpp:56
Provides data structures for representing various animation types and their essential components.