From 7fe808b2a195b04d3dc88e562fa6604c6bfdde0a Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 28 Jul 2021 09:36:50 -0500 Subject: [PATCH] Tweak sync queries to include positions for which rigid body/collider positions aren't automatically synced by Rapier. --- src/core.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/core.rs b/src/core.rs index ed5bec8..58c1000 100644 --- a/src/core.rs +++ b/src/core.rs @@ -563,7 +563,9 @@ fn copy_coordinates_to_transform( ( Changed, Without, + Without, Without, + Without, ), >, ) { @@ -580,7 +582,10 @@ fn copy_coordinates_to_transform( } fn copy_rigid_body_position_to_coordinates( - mut query: Query<(&mut Coordinates, &RigidBodyPosition), Changed>, + mut query: Query< + (&mut Coordinates, &RigidBodyPosition), + (Changed, With), + >, ) { for (mut coordinates, position) in query.iter_mut() { if coordinates.0 .0 != position.position.translation.x { @@ -595,7 +600,11 @@ fn copy_rigid_body_position_to_coordinates( fn copy_collider_position_to_coordinates( mut query: Query< (&mut Coordinates, &ColliderPosition), - (Without, Changed), + ( + Without, + Changed, + With, + ), >, ) { for (mut coordinates, position) in query.iter_mut() {