mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-27 08:48:14 +00:00
WIP asset loader for BVH files
This commit is contained in:
@@ -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,
|
||||
}
|
||||
Reference in New Issue
Block a user