From 66b6b55ea21b6b43fd1870dba0fab3cc96a3fa4b Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 1 Jul 2024 11:49:41 +0300 Subject: [PATCH] Rotation gizmo for Ball 2d collider (#670) --- CHANGELOG.md | 5 +++++ .../debug_render_pipeline/debug_render_pipeline.rs | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4a0f365..0cfe853a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## Unreleased + +### Added +- Implement rotation gizmo for Ball 2D shape (as radius line) in Debug renderer if `DebugRenderMode::COLLIDER_SHAPES` enabled + ## v0.21.0 (23 June 2024) ### Fix diff --git a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs index 831f815a3..f2e23cd3d 100644 --- a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs +++ b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs @@ -369,6 +369,13 @@ impl DebugRenderPipeline { &Vector::repeat(s.radius * 2.0), color, true, + ); + // Draw a radius line to visualize rotation + backend.draw_line( + object, + pos * Point::new(s.radius * 0.2, 0.0), + pos * Point::new(s.radius * 0.8, 0.0), + color, ) } TypedShape::Cuboid(s) => {