Added the ability to spawn a mannequin

This commit is contained in:
Brooks Palin
2024-03-12 15:26:04 -06:00
parent ffba0b940f
commit 1ef2afc685
6 changed files with 44 additions and 7 deletions
+6 -6
View File
@@ -58,13 +58,13 @@ fn spawn_test_bvh(
let ent = cmd.spawn_bvh_with_transform(
&r_bvh.0,
Transform::from_scale(Vec3::splat(0.06))
.with_translation(Vec3::new(0., 1.0, 0.524)),
);
// let ent = cmd.spawn_bvh_with_transform(
// &r_bvh.0,
// Transform::from_scale(Vec3::splat(0.06))
// .with_translation(Vec3::new(0., 1.0, 0.524)),
// );
cmd.entity(ent).insert(RetargetSource);
// cmd.entity(ent).insert(RetargetSource);
}
}
}
+25
View File
@@ -596,4 +596,29 @@ declare global {
Ok(())
}
//==============================================================================
// Spawing GLTF objects
//==============================================================================
// static LOAD_GLTF : WasmMessageBuffer<String> = WasmMessageBuffer::new();
// #[wasm_bindgen(js_name = spawnGltf)]
// pub fn spawn_gltf(path : String) {
// let wrapper = LOAD_GLTF.get_or_init(|| ReentrantMutex::new(RefCell::new(Some(path.clone()))));
// let guard = wrapper.lock();
// *guard.borrow_mut() = Some(path);
// }
// pub(super) fn load_gltf_object(
// mut load_object_event: EventWriter<LoadLibraryObjectEvent>
// ) {
// let wrapper = LOAD_GLTF.get_or_init(|| ReentrantMutex::new(RefCell::new(Some(path.clone()))));
// let guard = wrapper.lock();
// if guard.borrow().is_some() {
// load_object_event.send(LoadLibraryObjectEvent(guard.take().unwrap()));
// }
// }
}
+1 -1
View File
@@ -31,4 +31,4 @@ pub(crate) fn initialize() {
let wrapper = INITIALIZED.get_or_init(|| ReentrantMutex::new(RefCell::new(false)));
let guard = wrapper.lock();
*guard.borrow_mut() = true;
}
}