diff options
| author | Sébastien Crozet <sebcrozet@dimforge.com> | 2024-04-07 22:17:59 +0200 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2024-04-30 23:10:46 +0200 |
| commit | a44f39a7b6156f1cbbb988082be1ea3e29b957c2 (patch) | |
| tree | a16d62a5e99f78f1966a1e4e7bdc3da84f14bcbb | |
| parent | 7cbbb8e87b2710e819ca179b2f43c1a7633aedfa (diff) | |
| download | rapier-a44f39a7b6156f1cbbb988082be1ea3e29b957c2.tar.gz rapier-a44f39a7b6156f1cbbb988082be1ea3e29b957c2.tar.bz2 rapier-a44f39a7b6156f1cbbb988082be1ea3e29b957c2.zip | |
fix contact debug-rendering for compound shapes
| -rw-r--r-- | src/pipeline/debug_render_pipeline/debug_render_pipeline.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs index b429c90..041862c 100644 --- a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs +++ b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs @@ -9,6 +9,7 @@ use crate::math::{Isometry, Point, Real, Vector, DIM}; use crate::pipeline::debug_render_pipeline::debug_render_backend::DebugRenderObject; use crate::pipeline::debug_render_pipeline::DebugRenderStyle; use crate::utils::SimdBasis; +use parry::utils::IsometryOpt; use std::any::TypeId; use std::collections::HashMap; @@ -115,16 +116,19 @@ impl DebugRenderPipeline { if backend.filter_object(object) { for manifold in &pair.manifolds { for contact in manifold.contacts() { + let world_subshape_pos1 = + manifold.subshape_pos1.prepend_to(co1.position()); backend.draw_line( object, - co1.position() * contact.local_p1, - co2.position() * contact.local_p2, + world_subshape_pos1 * contact.local_p1, + manifold.subshape_pos2.prepend_to(co2.position()) + * contact.local_p2, self.style.contact_depth_color, ); backend.draw_line( object, - co1.position() * contact.local_p1, - co1.position() + world_subshape_pos1 * contact.local_p1, + world_subshape_pos1 * (contact.local_p1 + manifold.local_n1 * self.style.contact_normal_length), self.style.contact_normal_color, |
