Skip to content

Commit f058055

Browse files
committed
feat: animation module docs
1 parent a8a9c54 commit f058055

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

crates/league-toolkit/src/core/animation/asset/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Animation assets
12
mod compressed;
23

34
pub use compressed::*;
@@ -15,12 +16,15 @@ use error::AssetParseError::UnknownAssetType;
1516
use std::io;
1617
use std::io::{Read, Seek, SeekFrom};
1718

19+
/// Encapsulates a .anm file
1820
#[derive(Clone, Debug)]
1921
pub enum AnimationAsset {
2022
Uncompressed(Uncompressed),
2123
Compressed(Compressed),
2224
}
2325

26+
/// The type of animation asset
27+
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
2428
pub enum AnimationAssetType {
2529
Uncompressed,
2630
Compressed,
@@ -40,6 +44,7 @@ impl AnimationAsset {
4044
}
4145
}
4246

47+
/// Reads the animation magic (8 bytes), and identifies the animation asset type
4348
pub fn identify_from_reader<R: Read + ?Sized>(
4449
reader: &mut R,
4550
) -> io::Result<AnimationAssetType> {

crates/league-toolkit/src/core/animation/rig/builder.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::core::animation::{joint, Joint, RigResource};
22
use std::collections::VecDeque;
33

4+
/// Builder for [`RigResource`]
45
pub struct Builder {
56
name: String,
67
asset_name: String,
@@ -15,11 +16,13 @@ impl Builder {
1516
root_joints: vec![],
1617
}
1718
}
19+
1820
pub fn with_root_joint(mut self, child: joint::Builder) -> Self {
1921
self.add_root_joint(child);
2022
self
2123
}
2224

25+
/// Mutably add a root joint
2326
pub fn add_root_joint(&mut self, child: joint::Builder) {
2427
self.root_joints.push(child);
2528
}

crates/league-toolkit/src/core/animation/rig/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
//! Read/write .skl
12
mod builder;
23
mod read;
34
mod write;
45
pub use builder::Builder;
56

67
use super::Joint;
78

9+
/// Encapsulates a .skl file
810
#[derive(Debug, Clone, PartialEq)]
911
pub struct RigResource {
1012
flags: u16,

0 commit comments

Comments
 (0)