From be2477c0fa161689ff02ec96b177a26594f1925b Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 17:00:32 +0100 Subject: chore: Apply final code formatting and cleanup --- src/3d/visual_debug.cc | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'src/3d/visual_debug.cc') diff --git a/src/3d/visual_debug.cc b/src/3d/visual_debug.cc index c6c5c51..51ccc39 100644 --- a/src/3d/visual_debug.cc +++ b/src/3d/visual_debug.cc @@ -174,25 +174,32 @@ void VisualDebug::create_pipeline(WGPUTextureFormat format) { } void VisualDebug::add_box(const mat4& transform, const vec3& local_extent, - const vec3& color) { + const vec3& color) { float lx = local_extent.x; float ly = local_extent.y; float lz = local_extent.z; // 8 corners of transformed box - vec4 p[] = {transform * vec4(-lx, -ly, -lz, 1), transform * vec4(lx, -ly, -lz, 1), - transform * vec4(lx, ly, -lz, 1), transform * vec4(-lx, ly, -lz, 1), - transform * vec4(-lx, -ly, lz, 1), transform * vec4(lx, -ly, lz, 1), - transform * vec4(lx, ly, lz, 1), transform * vec4(-lx, ly, lz, 1)}; + vec4 p[] = { + transform * vec4(-lx, -ly, -lz, 1), transform * vec4(lx, -ly, -lz, 1), + transform * vec4(lx, ly, -lz, 1), transform * vec4(-lx, ly, -lz, 1), + transform * vec4(-lx, -ly, lz, 1), transform * vec4(lx, -ly, lz, 1), + transform * vec4(lx, ly, lz, 1), transform * vec4(-lx, ly, lz, 1)}; // 12 edges (each 2 vertices) DebugLine edges[] = { - {p[0].xyz(), p[1].xyz(), color}, {p[1].xyz(), p[2].xyz(), color}, - {p[2].xyz(), p[3].xyz(), color}, {p[3].xyz(), p[0].xyz(), color}, // Front face - {p[4].xyz(), p[5].xyz(), color}, {p[5].xyz(), p[6].xyz(), color}, - {p[6].xyz(), p[7].xyz(), color}, {p[7].xyz(), p[4].xyz(), color}, // Back face - {p[0].xyz(), p[4].xyz(), color}, {p[1].xyz(), p[5].xyz(), color}, - {p[2].xyz(), p[6].xyz(), color}, {p[3].xyz(), p[7].xyz(), color} // Connecting edges + {p[0].xyz(), p[1].xyz(), color}, + {p[1].xyz(), p[2].xyz(), color}, + {p[2].xyz(), p[3].xyz(), color}, + {p[3].xyz(), p[0].xyz(), color}, // Front face + {p[4].xyz(), p[5].xyz(), color}, + {p[5].xyz(), p[6].xyz(), color}, + {p[6].xyz(), p[7].xyz(), color}, + {p[7].xyz(), p[4].xyz(), color}, // Back face + {p[0].xyz(), p[4].xyz(), color}, + {p[1].xyz(), p[5].xyz(), color}, + {p[2].xyz(), p[6].xyz(), color}, + {p[3].xyz(), p[7].xyz(), color} // Connecting edges }; for (const auto& l : edges) { -- cgit v1.2.3