|
NSUNI/NSLAR Library a250670
|
Classes | |
| struct | nnl::animation::KeyFrame |
| Represents a keyframe in an animation. More... | |
| struct | nnl::animation::BoneAnimation |
| Represents the transformations of a bone during an animation. More... | |
| struct | nnl::animation::Animation |
| Represents a single skeletal animation. More... | |
| struct | nnl::animation::AnimationContainer |
| Holds a collection of skeletal animations. More... | |
| struct | nnl::animation::ConvertParam |
| Parameters for converting animations to the in-game format. More... | |
Functions | |
| std::vector< SAnimation > | nnl::animation::Convert (const AnimationContainer &animations) |
| Converts multiple in-game animations to a simpler format. | |
| AnimationContainer | nnl::animation::Convert (std::vector< SAnimation > &&sanimations, const ConvertParam &anim_params={}, bool move_with_root=false) |
| Converts multiple animations back to AnimationContainer. | |
| bool | nnl::animation::IsOfType (BufferView buffer) |
| Tests if the provided file is an animation container. | |
| AnimationContainer | nnl::animation::Import (BufferView buffer) |
| Imports animations from a binary file. | |
| Buffer | nnl::animation::Export (const AnimationContainer &animation_container) |
| Exports animations to a binary file format. | |
| struct nnl::animation::KeyFrame |
Represents a keyframe in an animation.
This struct encapsulates the time at which the keyframe occurs in the animation timeline, as well as a new value set at that keyframe.
Public Attributes | |
| u16 | time_tick {0} |
| glm::vec3 | value {0.0f} |
| u16 nnl::animation::KeyFrame::time_tick {0} |
Time in ticks (1 tick ~ 1 frame).
| glm::vec3 nnl::animation::KeyFrame::value {0.0f} |
The new value at the specified time. This can store scale, translation, or Euler rotation (pitch, yaw, roll) in degrees. Note that rotation values must be in the range [-180, 180].
| struct nnl::animation::BoneAnimation |
Represents the transformations of a bone during an animation.
This struct contains keyframes that set new scale, rotatation, and translation transformations of a bone.
Public Attributes | |
| std::vector< KeyFrame > | scale_keys |
| Scale keys. | |
| std::vector< KeyFrame > | rotation_keys |
| Rotation keys. | |
| std::vector< KeyFrame > | translation_keys |
| Translation keys. | |
| std::vector<KeyFrame> nnl::animation::BoneAnimation::rotation_keys |
Rotation keys.
| std::vector<KeyFrame> nnl::animation::BoneAnimation::scale_keys |
Scale keys.
| std::vector<KeyFrame> nnl::animation::BoneAnimation::translation_keys |
Translation keys.
| struct nnl::animation::Animation |
Represents a single skeletal animation.
Public Attributes | |
| u16 | duration_ticks = 1 |
| std::vector< BoneAnimation > | animation_channels |
| std::vector<BoneAnimation> nnl::animation::Animation::animation_channels |
Bone animation data for each bone of a skeleton.
| u16 nnl::animation::Animation::duration_ticks = 1 |
The duration of the animation in ticks. In general, it should be set to the time of the last keyframe + 1.
| struct nnl::animation::AnimationContainer |
Holds a collection of skeletal animations.
Public Attributes | |
| bool | move_with_root = false |
| std::vector< Animation > | animations |
| Collection of animations. | |
| std::vector<Animation> nnl::animation::AnimationContainer::animations |
Collection of animations.
| bool nnl::animation::AnimationContainer::move_with_root = false |
Doesn't affect anything (?). It reflects the value of the same flag from the Model struct
| struct nnl::animation::ConvertParam |
Parameters for converting animations to the in-game format.
Public Attributes | |
| bool | unbake = true |
| Remove keyframes that are duplicate or can be derived via interpolation. | |
| bool nnl::animation::ConvertParam::unbake = true |
Remove keyframes that are duplicate or can be derived via interpolation.
| std::vector< SAnimation > nnl::animation::Convert | ( | const AnimationContainer & | animations | ) |
Converts multiple in-game animations to a simpler format.
This function takes an AnimationContainer object and converts all contained animations into a format that is more suitable for exporting to other formats.
It performs the following data normalization:
| animations | The container of in-game animations to be converted. |
| AnimationContainer nnl::animation::Convert | ( | std::vector< SAnimation > && | sanimations, |
| const ConvertParam & | anim_params = {}, | ||
| bool | move_with_root = false ) |
Converts multiple animations back to AnimationContainer.
This function takes a vector of SAnimation objects and converts them into an AnimationContainer object that represent the in-game animation format.
| sanimations | The vector of animations to be converted. |
| anim_params | Conversion parameters |
| move_with_root | Sets the respective value to true or false. Has no noticeable effect. |
|
nodiscard |
Exports animations to a binary file format.
This function takes an AnimationContainer and exports it into the binary format.
| animation_container | The container of animations to be exported. |
| AnimationContainer nnl::animation::Import | ( | BufferView | buffer | ) |
Imports animations from a binary file.
This function takes a file buffer, parses its contents, and returns an AnimationContainer object.
| buffer | The binary file to be imported. |
| bool nnl::animation::IsOfType | ( | BufferView | buffer | ) |
Tests if the provided file is an animation container.
This function takes a file buffer and checks whether it corresponds to the in-game animation format.
| buffer | The binary file to be tested. |