Avoid unnecessary coordinate changes.
This commit is contained in:
parent
2635dcbb9c
commit
3994c1c744
|
@ -565,13 +565,17 @@ fn copy_coordinates_to_transform(
|
|||
}
|
||||
|
||||
fn copy_rigid_body_position_to_coordinates(
|
||||
mut query: Query<(&mut Coordinates, &RigidBodyPosition)>,
|
||||
mut query: Query<(&mut Coordinates, &RigidBodyPosition), Changed<RigidBodyPosition>>,
|
||||
) {
|
||||
for (mut coordinates, position) in query.iter_mut() {
|
||||
if coordinates.0 .0 != position.position.translation.x {
|
||||
coordinates.0 .0 = position.position.translation.x;
|
||||
}
|
||||
if coordinates.0 .1 != position.position.translation.y {
|
||||
coordinates.0 .1 = position.position.translation.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct CoreConfig {
|
||||
|
|
Loading…
Reference in New Issue
Block a user