Tweak sync queries to include positions for which rigid body/collider positions aren't automatically synced by Rapier.
This commit is contained in:
parent
7f61eb3a90
commit
7fe808b2a1
13
src/core.rs
13
src/core.rs
|
@ -563,7 +563,9 @@ fn copy_coordinates_to_transform(
|
||||||
(
|
(
|
||||||
Changed<Transform>,
|
Changed<Transform>,
|
||||||
Without<RigidBodyPosition>,
|
Without<RigidBodyPosition>,
|
||||||
|
Without<RigidBodyPositionSync>,
|
||||||
Without<ColliderPosition>,
|
Without<ColliderPosition>,
|
||||||
|
Without<ColliderPositionSync>,
|
||||||
),
|
),
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
|
@ -580,7 +582,10 @@ fn copy_coordinates_to_transform(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn copy_rigid_body_position_to_coordinates(
|
fn copy_rigid_body_position_to_coordinates(
|
||||||
mut query: Query<(&mut Coordinates, &RigidBodyPosition), Changed<RigidBodyPosition>>,
|
mut query: Query<
|
||||||
|
(&mut Coordinates, &RigidBodyPosition),
|
||||||
|
(Changed<RigidBodyPosition>, With<RigidBodyPositionSync>),
|
||||||
|
>,
|
||||||
) {
|
) {
|
||||||
for (mut coordinates, position) in query.iter_mut() {
|
for (mut coordinates, position) in query.iter_mut() {
|
||||||
if coordinates.0 .0 != position.position.translation.x {
|
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(
|
fn copy_collider_position_to_coordinates(
|
||||||
mut query: Query<
|
mut query: Query<
|
||||||
(&mut Coordinates, &ColliderPosition),
|
(&mut Coordinates, &ColliderPosition),
|
||||||
(Without<RigidBodyPosition>, Changed<ColliderPosition>),
|
(
|
||||||
|
Without<RigidBodyPosition>,
|
||||||
|
Changed<ColliderPosition>,
|
||||||
|
With<ColliderPositionSync>,
|
||||||
|
),
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
for (mut coordinates, position) in query.iter_mut() {
|
for (mut coordinates, position) in query.iter_mut() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user