Register BindPose components for Space Editor UI

This commit is contained in:
Danny McGee
2024-02-02 14:39:50 -05:00
parent c43ff4ccba
commit f1f7616590
+14 -4
View File
@@ -13,7 +13,10 @@ use bevy::{
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")]
use wasm_bindgen::prelude::wasm_bindgen;
@@ -68,6 +71,10 @@ impl Plugin for ScenePlugin {
//setup default light
app.add_systems(Startup, minimal_scene_setup);
app.editor_registry::<BindPoseLocal>();
app.editor_registry::<BindPoseGlobal>();
app.editor_registry::<InvBindPose>();
#[cfg(feature = "wasm")]
app.add_systems(
Update,
@@ -191,13 +198,16 @@ pub struct SceneRoot;
#[derive(Resource, Deref, DerefMut)]
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);
#[derive(Component, Clone, Copy, Debug, Deref, DerefMut)]
#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)]
#[reflect(Component)]
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);
fn initialize(mut cmd: Commands) {