mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
Move animation components to new anim module
This commit is contained in:
@@ -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);
|
||||
@@ -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
@@ -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)]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -5,7 +5,7 @@ use bevy::{
|
||||
utils::{HashMap, HashSet},
|
||||
};
|
||||
|
||||
use crate::scene::Skeleton;
|
||||
use crate::anim::Skeleton;
|
||||
|
||||
pub struct MixamoPlugin;
|
||||
|
||||
|
||||
+2
-16
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user