2019-01-14 14:40:22 +00:00
|
|
|
pub mod run;
|
|
|
|
|
|
|
|
// Reexports
|
|
|
|
pub use self::run::RunAnimation;
|
|
|
|
|
|
|
|
// Crate
|
|
|
|
use crate::render::FigureBoneData;
|
|
|
|
|
|
|
|
// Local
|
|
|
|
use super::{
|
|
|
|
Skeleton,
|
|
|
|
Bone,
|
|
|
|
};
|
|
|
|
|
|
|
|
pub struct CharacterSkeleton {
|
|
|
|
head: Bone,
|
|
|
|
chest: Bone,
|
2019-03-05 00:00:11 +00:00
|
|
|
belt: Bone,
|
|
|
|
shorts: Bone,
|
2019-03-02 22:41:34 +00:00
|
|
|
l_hand: Bone,
|
2019-03-05 00:00:11 +00:00
|
|
|
r_hand: Bone,
|
2019-01-14 14:40:22 +00:00
|
|
|
l_foot: Bone,
|
|
|
|
r_foot: Bone,
|
|
|
|
back: Bone,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl CharacterSkeleton {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
Self {
|
|
|
|
head: Bone::default(),
|
|
|
|
chest: Bone::default(),
|
2019-03-05 00:00:11 +00:00
|
|
|
belt: Bone::default(),
|
|
|
|
shorts: Bone::default(),
|
2019-03-02 22:41:34 +00:00
|
|
|
l_hand: Bone::default(),
|
2019-03-05 00:00:11 +00:00
|
|
|
r_hand: Bone::default(),
|
2019-01-14 14:40:22 +00:00
|
|
|
l_foot: Bone::default(),
|
|
|
|
r_foot: Bone::default(),
|
|
|
|
back: Bone::default(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Skeleton for CharacterSkeleton {
|
|
|
|
fn compute_matrices(&self) -> [FigureBoneData; 16] {
|
|
|
|
let chest_mat = self.chest.compute_base_matrix();
|
|
|
|
|
|
|
|
[
|
|
|
|
FigureBoneData::new(self.head.compute_base_matrix()),
|
|
|
|
FigureBoneData::new(chest_mat),
|
2019-03-05 00:00:11 +00:00
|
|
|
FigureBoneData::new(self.belt.compute_base_matrix()),
|
|
|
|
FigureBoneData::new(self.shorts.compute_base_matrix()),
|
2019-03-02 22:41:34 +00:00
|
|
|
FigureBoneData::new(self.l_hand.compute_base_matrix()),
|
2019-03-05 00:00:11 +00:00
|
|
|
FigureBoneData::new(self.r_hand.compute_base_matrix()),
|
2019-01-14 14:40:22 +00:00
|
|
|
FigureBoneData::new(self.l_foot.compute_base_matrix()),
|
|
|
|
FigureBoneData::new(self.r_foot.compute_base_matrix()),
|
|
|
|
FigureBoneData::new(chest_mat * self.back.compute_base_matrix()),
|
|
|
|
FigureBoneData::default(),
|
|
|
|
FigureBoneData::default(),
|
|
|
|
FigureBoneData::default(),
|
|
|
|
FigureBoneData::default(),
|
|
|
|
FigureBoneData::default(),
|
|
|
|
FigureBoneData::default(),
|
|
|
|
FigureBoneData::default(),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|