Broad-phase: discard NAN/Inf AABBs.

This commit is contained in:
Sébastien Crozet
2022-06-24 11:56:28 +02:00
parent 9e431fb392
commit be5b6813a9

View File

@@ -8,7 +8,7 @@ use crate::geometry::{
};
use crate::math::Real;
use crate::utils::IndexMut2;
use parry::bounding_volume::BoundingVolume;
use parry::bounding_volume::{BoundingVolume, AABB};
use parry::utils::hashmap::HashMap;
/// A broad-phase combining a Hierarchical Grid and Sweep-and-Prune.
@@ -352,8 +352,16 @@ impl BroadPhase {
.compute_aabb(co_pos)
.loosened(prediction_distance / 2.0);
if aabb.mins.coords.iter().any(|e| !e.is_finite())
|| aabb.maxs.coords.iter().any(|e| !e.is_finite())
{
// Reject AABBs with non-finite values.
return false;
}
aabb.mins = super::clamp_point(aabb.mins);
aabb.maxs = super::clamp_point(aabb.maxs);
let prev_aabb;
let layer_id = if let Some(proxy) = self.proxies.get_mut(*proxy_index) {