aboutsummaryrefslogtreecommitdiff
path: root/src_testbed/graphics.rs
diff options
context:
space:
mode:
authorrezural <rezural@protonmail.com>2021-06-28 11:05:55 +1000
committerSébastien Crozet <sebastien@crozet.re>2021-07-08 10:07:42 +0200
commit7c249c873d28b4fa03023bff6fe3bf5df7a1cee9 (patch)
treede9c0095da5449e6e438284c572e48164e3f93cb /src_testbed/graphics.rs
parent62d6b0651b35b5b354c18b386d8a4e2c9669fd2f (diff)
downloadrapier-7c249c873d28b4fa03023bff6fe3bf5df7a1cee9.tar.gz
rapier-7c249c873d28b4fa03023bff6fe3bf5df7a1cee9.tar.bz2
rapier-7c249c873d28b4fa03023bff6fe3bf5df7a1cee9.zip
enable clear_graphics and run_callbacks agin
update plugin signature to recieve bevy structs, add Arc<Mutex<>> around gfx_components, we we can get shared mutable access add prefab_meshes() access function Remove Arc<Mutex<>>
Diffstat (limited to 'src_testbed/graphics.rs')
-rw-r--r--src_testbed/graphics.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src_testbed/graphics.rs b/src_testbed/graphics.rs
index 060798c..0682f63 100644
--- a/src_testbed/graphics.rs
+++ b/src_testbed/graphics.rs
@@ -195,9 +195,9 @@ impl GraphicsManager {
.cloned()
.unwrap_or_else(|| self.alloc_color(materials, handle, !body.is_dynamic()));
- self.add_with_color(
+ let _ = self.add_with_color(
commands, meshes, materials, components, handle, bodies, colliders, color,
- )
+ );
}
pub fn add_with_color(
@@ -210,8 +210,7 @@ impl GraphicsManager {
bodies: &RigidBodySet,
colliders: &ColliderSet,
color: Point3<f32>,
- ) {
- // let body = bodies.get(handle).unwrap();
+ ) -> Vec<EntityWithGraphics> {
let mut new_nodes = Vec::new();
for collider_handle in bodies[handle].colliders() {
@@ -246,7 +245,10 @@ impl GraphicsManager {
// }
let nodes = self.b2sn.entry(handle).or_insert_with(Vec::new);
- nodes.append(&mut new_nodes);
+
+ nodes.append(&mut new_nodes.clone());
+
+ new_nodes
}
pub fn add_collider(