use better contact point for inter-gear collision
authoralfadur
Thu, 25 Jul 2019 21:59:20 +0300
changeset 15273 bfd185ad03e7
parent 15272 3053d07a7840
child 15274 42b710b0f883
use better contact point for inter-gear collision
rust/hwphysics/src/grid.rs
--- a/rust/hwphysics/src/grid.rs	Thu Jul 25 19:40:40 2019 +0200
+++ b/rust/hwphysics/src/grid.rs	Thu Jul 25 21:59:20 2019 +0300
@@ -120,7 +120,7 @@
                         collisions.push(
                             bin.dynamic_refs[index],
                             Some(bin.dynamic_refs[other_index]),
-                            &bounds.center,
+                            &((bounds.center + other.center) / 2),
                         )
                     }
                 }
@@ -130,7 +130,7 @@
                         collisions.push(
                             bin.dynamic_refs[index],
                             Some(bin.static_refs[other_index]),
-                            &bounds.center,
+                            &((bounds.center + other.center) / 2),
                         )
                     }
                 }