mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-18 07:35:19 +00:00
BVH animation loading / retargeting (#25)
This PR adds support for BVH animation files, with a custom animation player and retargeting solution for our Blender Rigify-based skeletal meshes. --------- Co-authored-by: Brooks Palin <brookspalin710@gmail.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
use crate::Bvh;
|
||||
use mint::Vector3;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct JointCursor<'a> {
|
||||
bvh: &'a mut Bvh,
|
||||
index: usize,
|
||||
}
|
||||
|
||||
impl<'a> JointCursor<'a> {
|
||||
#[inline]
|
||||
pub const fn index(&self) -> usize {
|
||||
self.index
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn push_joints(&mut self) -> PushJointsChain<'a> {
|
||||
PushJointsChain { cursor: self }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PushJointsChain<'a> {
|
||||
cursor: &'a mut JointCursor<'a>,
|
||||
}
|
||||
|
||||
impl<'a> PushJointsChain<'a> {
|
||||
pub fn push_joint<B: AsRef<[u8]>, V: Into<Vector3<f32>>>(
|
||||
&mut self,
|
||||
name: B,
|
||||
offset: V,
|
||||
) -> Self {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a mut Bvh> for JointCursor<'a> {
|
||||
#[inline]
|
||||
fn from(bvh: &'a mut Bvh) -> Self {
|
||||
Self { bvh, index: 0 }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user