Fix crash when removing a collider with no graph ID.
This commit is contained in:
@@ -137,8 +137,9 @@ impl NarrowPhase {
|
|||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
|
|
||||||
while let Some(collider) = colliders.removed_colliders.read_ith(&cursor, i) {
|
while let Some(collider) = colliders.removed_colliders.read_ith(&cursor, i) {
|
||||||
let graph_idx = self.graph_indices.get(collider.handle).unwrap();
|
// NOTE: if the collider does not have any graph indices currently, there is nothing
|
||||||
|
// to remove in the narrow-phase for this collider.
|
||||||
|
if let Some(graph_idx) = self.graph_indices.get(collider.handle) {
|
||||||
let proximity_graph_id = prox_id_remap
|
let proximity_graph_id = prox_id_remap
|
||||||
.get(&collider.handle)
|
.get(&collider.handle)
|
||||||
.copied()
|
.copied()
|
||||||
@@ -156,6 +157,7 @@ impl NarrowPhase {
|
|||||||
&mut prox_id_remap,
|
&mut prox_id_remap,
|
||||||
&mut contact_id_remap,
|
&mut contact_id_remap,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user