WIP asset loader for BVH files

This commit is contained in:
Danny McGee
2023-12-20 20:38:16 -05:00
parent 6606e5fb5b
commit 197f936785
7 changed files with 157 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
use bevy::{prelude::*, utils::HashMap};
mod error;
mod loader;
use self::loader::BvhLoader;
pub struct BvhPlugin;
impl Plugin for BvhPlugin {
fn build(&self, app: &mut App) {
app.init_asset::<Bvh>()
.init_asset::<BvhJoint>()
.register_asset_loader(BvhLoader);
}
}
#[derive(Asset, TypePath, Debug)]
pub struct Bvh {
pub joints: Vec<Handle<BvhJoint>>,
pub named_joints: HashMap<String, Handle<BvhJoint>>,
}
#[derive(Asset, TypePath, Debug, Clone)]
pub struct BvhJoint {
pub parent: Option<Handle<BvhJoint>>,
/// Local transform
pub transform: Transform,
}