Merge pull request #185 from dimforge/bf_bug
Fix crash in broad-phase after shape modification.
This commit is contained in:
@@ -369,6 +369,7 @@ impl BroadPhase {
|
||||
// We need to promote the proxy to the bigger layer.
|
||||
layer_id = self.ensure_layer_exists(new_layer_depth);
|
||||
self.proxies[*proxy_index].layer_id = layer_id;
|
||||
self.proxies[*proxy_index].layer_depth = new_layer_depth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,11 @@ impl SAPRegion {
|
||||
///
|
||||
/// Returns `true` if this region contained the proxy. Returns `false` otherwise.
|
||||
pub fn proper_proxy_moved_to_a_bigger_layer(&mut self, proxy_id: SAPProxyIndex) -> bool {
|
||||
if self.existing_proxies[proxy_id as usize] {
|
||||
if self.existing_proxies.get(proxy_id as usize) == Some(true) {
|
||||
// NOTE: we are just registering the fact that that proxy isn't a
|
||||
// subproper proxy anymore. But it is still part of this region
|
||||
// so we must not set `self.existing_proxies[proxy_id] = false`
|
||||
// nor delete its endpoints.
|
||||
self.subproper_proxy_count -= 1;
|
||||
true
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user