From 0b8bf331499ad7dcef5c9952de8e77eebba514a7 Mon Sep 17 00:00:00 2001 From: Patrick Zhao Date: Fri, 12 Jul 2024 23:44:04 +0200 Subject: [PATCH] Add parry's TriMeshFlags::FIX_INTERNAL_EDGES to avian's TrimeshFlags --- src/collision/collider/parry/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/collision/collider/parry/mod.rs b/src/collision/collider/parry/mod.rs index a5e93fd4..3924f340 100644 --- a/src/collision/collider/parry/mod.rs +++ b/src/collision/collider/parry/mod.rs @@ -196,6 +196,13 @@ bitflags::bitflags! { /// vertices will be merged. It will no longer be the case in the future once we decouple /// the computations. const DELETE_DUPLICATE_TRIANGLES = 0b0100_0000; + /// If set, a special treatment will be applied to contact manifold calculation to eliminate + /// or fix contacts normals that could lead to incorrect bumps in physics simulation + /// (especially on flat surfaces). + /// + /// This is achieved by taking into account adjacent triangle normals when computing contact + /// points for a given triangle. + const FIX_INTERNAL_EDGES = 0b1000_0000 | Self::ORIENTED.bits() | Self::MERGE_DUPLICATE_VERTICES.bits(); } }