Skip to content

Commit

Permalink
Rename char bone
Browse files Browse the repository at this point in the history
  • Loading branch information
PikminGuts92 committed Feb 9, 2025
1 parent 2ec5523 commit 179987a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions core/grim/src/scene/char_bones_samples/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub(crate) fn load_char_bones_samples_header(char_bones_samples: &mut CharBonesS

char_bones_samples.bones = bones
.iter()
.map(|(name, weight)| CharBone {
.map(|(name, weight)| CharBone4Bone {
symbol: name.to_owned(),
weight: *weight,
})
Expand Down Expand Up @@ -152,7 +152,7 @@ pub(crate) fn load_char_bones_samples_data(char_bones_samples: &mut CharBonesSam
}

char_bones_samples.samples = EncodedSamples::Compressed(
bones.into_iter().map(|(s, w)| CharBone { symbol: s, weight: w }).collect(),
bones.into_iter().map(|(s, w)| CharBone4Bone { symbol: s, weight: w }).collect(),
samples
);

Expand Down
12 changes: 6 additions & 6 deletions core/grim/src/scene/char_bones_samples/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub use io::*;
const MAX_ROTATION_DEGREES: f32 = 1080.0; // 3 rotations

#[derive(Debug, Clone, Default)]
pub struct CharBone {
pub struct CharBone4Bone {
pub symbol: String, // Bone name + transform property ext
pub weight: f32,
}
Expand All @@ -25,7 +25,7 @@ pub struct CharBoneSample {

#[derive(Debug)]
pub enum EncodedSamples {
Compressed(Vec<CharBone>, Vec<Box<[u8]>>), // Raw sample collection of bone transforms
Compressed(Vec<CharBone4Bone>, Vec<Box<[u8]>>), // Raw sample collection of bone transforms
Uncompressed(Vec<CharBoneSample>) // Collections of samples grouped by bone transforms
}

Expand All @@ -37,7 +37,7 @@ impl Default for EncodedSamples {

#[derive(Debug, Default)]
pub struct CharBonesSamples { // Sample set
pub bones: Vec<CharBone>,
pub bones: Vec<CharBone4Bone>,
pub compression: u32, // TODO: Convert to enum?
pub counts: [u32; 7], // Offsets
pub computed_sizes: [u32; 7],
Expand Down Expand Up @@ -130,21 +130,21 @@ impl CharBonesSamples {
.iter()
.fold((Vec::new(), Vec::new(), Vec::new()), |(mut pos, mut quat, mut rotz), s| {
if let Some((w, _)) = s.pos {
pos.push(CharBone {
pos.push(CharBone4Bone {
symbol: format!("{}.pos", s.symbol),
weight: w,
});
}

if let Some((w, _)) = s.quat {
quat.push(CharBone {
quat.push(CharBone4Bone {
symbol: format!("{}.quat", s.symbol),
weight: w,
});
}

if let Some((w, _)) = s.rotz {
rotz.push(CharBone {
rotz.push(CharBone4Bone {
symbol: format!("{}.rotz", s.symbol),
weight: w,
});
Expand Down
4 changes: 2 additions & 2 deletions core/grim/src/scene/char_clip_samples/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use grim_macros::*;
use grim_traits::scene::*;
pub use io::*;

use super::{CharBone, CharBonesSamples};
use super::{CharBone4Bone, CharBonesSamples};

#[milo]
pub struct CharClipSamples {
Expand All @@ -31,7 +31,7 @@ pub struct CharClipSamples {
pub some_bool: bool,
pub full: CharBonesSamples,
pub one: CharBonesSamples,
pub bones: Vec<CharBone>,
pub bones: Vec<CharBone4Bone>,
}

impl Default for CharClipSamples {
Expand Down

0 comments on commit 179987a

Please sign in to comment.