Move animation components to new anim module

This commit is contained in:
Danny McGee
2024-01-27 18:52:00 -05:00
parent aaa41cf2f6
commit 69d0c738a3
6 changed files with 24 additions and 21 deletions
+16
View File
@@ -0,0 +1,16 @@
use bevy::{math::Affine3A, prelude::*};
#[derive(Component)]
pub struct SkeletalJoint(pub Color);
#[derive(Component)]
pub struct Skeleton;
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
pub struct BindPoseLocal(pub Transform);
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
pub struct BindPoseGlobal(pub Affine3A);
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
pub struct InvBindPose(pub Affine3A);
+2 -1
View File
@@ -13,8 +13,9 @@ mod error;
mod loader;
use crate::{
anim::{BindPoseGlobal, InvBindPose, SkeletalJoint},
math::{Lerp, MatrixExtras},
scene::{BindPoseGlobal, InvBindPose, SceneState, SkeletalJoint},
scene::SceneState,
};
use self::loader::BvhLoader;
+2 -3
View File
@@ -5,11 +5,10 @@ use bevy_inspector_egui::quick::WorldInspectorPlugin;
use bevy_mod_picking::debug::DebugPickingMode;
use crate::{
anim::SkeletalJoint,
camera_controller::{CameraController, CameraMotionSystem},
input::{Action, InputAction, Lifecycle},
is_editor,
scene::SkeletalJoint,
MainCamera,
is_editor, MainCamera,
};
#[derive(Resource, Deref, DerefMut)]
+1
View File
@@ -9,6 +9,7 @@ use space_editor::prelude::space_undo::UndoPlugin;
use wasm_bindgen::prelude::*;
mod algo;
mod anim;
mod bvh;
mod camera_controller;
mod debug;
+1 -1
View File
@@ -5,7 +5,7 @@ use bevy::{
utils::{HashMap, HashSet},
};
use crate::scene::Skeleton;
use crate::anim::Skeleton;
pub struct MixamoPlugin;
+2 -16
View File
@@ -6,7 +6,7 @@ use bevy::{
tonemapping::Tonemapping,
},
gltf::Gltf,
math::{vec2, vec3, Affine3A},
math::{vec2, vec3},
pbr::ShadowFilteringMethod,
prelude::*,
render::{mesh::skinning::SkinnedMesh, primitives::Aabb, view::NoFrustumCulling},
@@ -19,6 +19,7 @@ use wasm_bindgen::prelude::wasm_bindgen;
use crate::{
algo,
anim::{BindPoseGlobal, BindPoseLocal, InvBindPose, SkeletalJoint, Skeleton},
bvh::{Bvh, CommandsSpawnBvhExt},
camera_controller::{CameraController, CameraControllerBundle},
debug::DebugPoint,
@@ -117,27 +118,12 @@ pub struct LoadSceneEvent(pub String);
#[derive(Component)]
pub struct SceneElement;
#[derive(Component)]
pub struct SkeletalJoint(pub Color);
#[derive(Component)]
pub struct Skeleton;
#[derive(Component)]
pub struct SceneRoot;
#[derive(Resource, Deref, DerefMut)]
pub struct TestBvh(pub Handle<Bvh>); // TODO
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
pub struct BindPoseLocal(pub Transform);
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
pub struct BindPoseGlobal(pub Affine3A);
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
pub struct InvBindPose(pub Affine3A);
fn initialize(mut cmd: Commands) {
// Camera, graphics settings
let focus = Vec3::ZERO;