diff options
| author | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-10-06 14:01:48 -0500 |
|---|---|---|
| committer | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-10-06 14:01:48 -0500 |
| commit | 0c1b210109e6d4816dc54f2a6dc93e8d6beb5089 (patch) | |
| tree | 047aaeae5d15c5bf1cbfa83f5e727a90a34d2cc7 /src | |
| parent | b614b3de5ed388ae0d848f00cc026b1c222584a3 (diff) | |
| download | rapier-0c1b210109e6d4816dc54f2a6dc93e8d6beb5089.tar.gz rapier-0c1b210109e6d4816dc54f2a6dc93e8d6beb5089.tar.bz2 rapier-0c1b210109e6d4816dc54f2a6dc93e8d6beb5089.zip | |
Fix corner case: exit on multiple axes
Diffstat (limited to 'src')
| -rw-r--r-- | src/geometry/broad_phase_multi_sap.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/geometry/broad_phase_multi_sap.rs b/src/geometry/broad_phase_multi_sap.rs index bb30e14..10c0c8b 100644 --- a/src/geometry/broad_phase_multi_sap.rs +++ b/src/geometry/broad_phase_multi_sap.rs @@ -208,8 +208,9 @@ impl SAPAxis { let mut deleted = 0; for endpoint in &self.endpoints { if endpoint.value < self.min_bound { - if endpoint.is_end() { - existing_proxies.set(endpoint.proxy() as usize, false); + let proxy_idx = endpoint.proxy() as usize; + if endpoint.is_end() && existing_proxies[proxy_idx] { + existing_proxies.set(proxy_idx, false); deleted += 1; } } else { @@ -219,7 +220,8 @@ impl SAPAxis { for endpoint in self.endpoints.iter().rev() { if endpoint.value > self.max_bound { - if endpoint.is_start() { + let proxy_idx = endpoint.proxy() as usize; + if endpoint.is_start() && existing_proxies[proxy_idx] { existing_proxies.set(endpoint.proxy() as usize, false); deleted += 1; } |
