mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-29 09:08:58 +00:00
Register BindPose components for Space Editor UI
This commit is contained in:
+14
-4
@@ -13,7 +13,10 @@ use bevy::{
|
|||||||
scene::InstanceId,
|
scene::InstanceId,
|
||||||
};
|
};
|
||||||
|
|
||||||
use space_editor::{prelude::PrefabMarker, space_prefab::component::SceneAutoChild};
|
use space_editor::{
|
||||||
|
prelude::PrefabMarker,
|
||||||
|
space_prefab::{component::SceneAutoChild, editor_registry::EditorRegistryExt},
|
||||||
|
};
|
||||||
#[cfg(feature = "wasm")]
|
#[cfg(feature = "wasm")]
|
||||||
use wasm_bindgen::prelude::wasm_bindgen;
|
use wasm_bindgen::prelude::wasm_bindgen;
|
||||||
|
|
||||||
@@ -68,6 +71,10 @@ impl Plugin for ScenePlugin {
|
|||||||
//setup default light
|
//setup default light
|
||||||
app.add_systems(Startup, minimal_scene_setup);
|
app.add_systems(Startup, minimal_scene_setup);
|
||||||
|
|
||||||
|
app.editor_registry::<BindPoseLocal>();
|
||||||
|
app.editor_registry::<BindPoseGlobal>();
|
||||||
|
app.editor_registry::<InvBindPose>();
|
||||||
|
|
||||||
#[cfg(feature = "wasm")]
|
#[cfg(feature = "wasm")]
|
||||||
app.add_systems(
|
app.add_systems(
|
||||||
Update,
|
Update,
|
||||||
@@ -191,13 +198,16 @@ pub struct SceneRoot;
|
|||||||
#[derive(Resource, Deref, DerefMut)]
|
#[derive(Resource, Deref, DerefMut)]
|
||||||
pub struct TestBvh(pub Handle<Bvh>); // TODO
|
pub struct TestBvh(pub Handle<Bvh>); // TODO
|
||||||
|
|
||||||
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
|
#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)]
|
||||||
|
#[reflect(Component)]
|
||||||
pub struct BindPoseLocal(pub Transform);
|
pub struct BindPoseLocal(pub Transform);
|
||||||
|
|
||||||
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
|
#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)]
|
||||||
|
#[reflect(Component)]
|
||||||
pub struct BindPoseGlobal(pub Affine3A);
|
pub struct BindPoseGlobal(pub Affine3A);
|
||||||
|
|
||||||
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
|
#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)]
|
||||||
|
#[reflect(Component)]
|
||||||
pub struct InvBindPose(pub Affine3A);
|
pub struct InvBindPose(pub Affine3A);
|
||||||
|
|
||||||
fn initialize(mut cmd: Commands) {
|
fn initialize(mut cmd: Commands) {
|
||||||
|
|||||||
Reference in New Issue
Block a user