diff --git a/CHANGELOG.md b/CHANGELOG.md index 6db3ea33..601028ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Fix - The region key has been replaced by an i64 in the f64 version of rapier, increasing the range before panics occur. +- Fix `BroadphaseMultiSap` not being able to serialize correctly with serde_json. ## v0.22.0 (20 July 2024) @@ -10,7 +11,7 @@ - Fix crash when removing a multibody joint, or a rigid-body with a multipody-joint attached to it. - Fix crash when inserting multibody joints in an arbitrary order (instead of incrementally from root to leaf). -- Fix `BroadphaseMultiSap` not being able to serialize correctly with serde_json. +- Fix `BroadphaseMultiSap` not being able to serialize a field with serde_json. ### Added diff --git a/src/geometry/broad_phase_multi_sap/sap_layer.rs b/src/geometry/broad_phase_multi_sap/sap_layer.rs index 80d920aa..241f8d2d 100644 --- a/src/geometry/broad_phase_multi_sap/sap_layer.rs +++ b/src/geometry/broad_phase_multi_sap/sap_layer.rs @@ -13,6 +13,13 @@ pub(crate) struct SAPLayer { pub smaller_layer: Option, pub larger_layer: Option, region_width: Real, + #[cfg_attr( + feature = "serde-serialize", + serde( + serialize_with = "crate::utils::serde::serialize_to_vec_tuple", + deserialize_with = "crate::utils::serde::deserialize_from_vec_tuple" + ) + )] pub regions: HashMap, BroadPhaseProxyIndex>, #[cfg_attr(feature = "serde-serialize", serde(skip))] regions_to_potentially_remove: Vec>, // Workspace