1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-23 21:17:45 +00:00

Improve SKLB documentation

This commit is contained in:
Joshua Goins 2023-12-02 19:57:04 -05:00
parent 7eb11e412f
commit a2db761e18

View file

@ -55,20 +55,27 @@ struct SKLB {
#[derive(Debug)]
pub struct Bone {
/// Name of the bone
pub name: String,
/// Index of the parent bone in the Skeleton's `bones` vector
pub parent_index: i32,
/// Position of the bone
pub position: [f32; 3],
/// Rotation quanternion of the bone
pub rotation: [f32; 4],
/// Scale of the bone
pub scale: [f32; 3],
}
#[derive(Debug)]
pub struct Skeleton {
/// Bones of this skeleton
pub bones: Vec<Bone>,
}
impl Skeleton {
/// Reads an existing SKLB file
pub fn from_existing(buffer: ByteSpan) -> Option<Skeleton> {
let mut cursor = Cursor::new(buffer);