Perform contact sorting in the narrow-phase directly.

This commit is contained in:
Crozet Sébastien
2020-12-31 11:16:03 +01:00
parent 64507a68e1
commit 967145a949
21 changed files with 116 additions and 206 deletions

View File

@@ -20,13 +20,9 @@ pub struct BodyPair {
}
impl BodyPair {
pub(crate) fn new(body1: RigidBodyHandle, body2: RigidBodyHandle) -> Self {
pub fn new(body1: RigidBodyHandle, body2: RigidBodyHandle) -> Self {
BodyPair { body1, body2 }
}
pub(crate) fn swap(self) -> Self {
Self::new(self.body2, self.body1)
}
}
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
@@ -479,7 +475,7 @@ impl RigidBodySet {
if let Some(contacts) = narrow_phase.contacts_with(*collider_handle) {
for inter in contacts {
for manifold in &inter.2.manifolds {
if manifold.num_active_contacts > 0 {
if !manifold.data.solver_contacts.is_empty() {
let other = crate::utils::other_handle(
(inter.0, inter.1),
*collider_handle,