Simplify BVH joints representation

This commit is contained in:
Danny McGee
2023-12-21 18:21:46 -05:00
parent 197f936785
commit 1bfb81f13d
4 changed files with 51 additions and 39 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
use bevy::{prelude::*, utils::HashMap};
use bevy::prelude::*;
mod error;
mod loader;
@@ -17,13 +17,14 @@ impl Plugin for BvhPlugin {
#[derive(Asset, TypePath, Debug)]
pub struct Bvh {
pub joints: Vec<Handle<BvhJoint>>,
pub named_joints: HashMap<String, Handle<BvhJoint>>,
pub joints: Vec<BvhJoint>,
}
#[derive(Asset, TypePath, Debug, Clone)]
pub struct BvhJoint {
pub parent: Option<Handle<BvhJoint>>,
pub name: String,
/// Local transform
pub transform: Transform,
/// Direct children of this joint
pub children: Vec<BvhJoint>,
}