From 8ce27b7e15f0fc65c8ee78950c7501660b936178 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 14 Feb 2026 15:14:25 +0100 Subject: style: Apply clang-format to codebase --- src/tests/3d/test_physics.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/tests/3d/test_physics.cc') diff --git a/src/tests/3d/test_physics.cc b/src/tests/3d/test_physics.cc index c1c5c32..6c1f814 100644 --- a/src/tests/3d/test_physics.cc +++ b/src/tests/3d/test_physics.cc @@ -1,10 +1,10 @@ // This file is part of the 64k demo project. // It tests the CPU-side SDF library and BVH for physics and collision. +#include "../common/test_math_helpers.h" #include "3d/bvh.h" #include "3d/physics.h" #include "3d/sdf_cpu.h" -#include "../common/test_math_helpers.h" #include #include @@ -46,18 +46,22 @@ void test_calc_normal() { // Sphere normal at (1,0,0) should be (1,0,0) auto sphere_sdf = [](vec3 p) { return sdf::sdSphere(p, 1.0f); }; vec3 n = sdf::calc_normal({1, 0, 0}, sphere_sdf); - assert(test_near(n.x, 1.0f, 0.001f) && test_near(n.y, 0.0f, 0.001f) && test_near(n.z, 0.0f, 0.001f)); + assert(test_near(n.x, 1.0f, 0.001f) && test_near(n.y, 0.0f, 0.001f) && + test_near(n.z, 0.0f, 0.001f)); // Box normal at side auto box_sdf = [](vec3 p) { return sdf::sdBox(p, {1, 1, 1}); }; n = sdf::calc_normal({1, 0, 0}, box_sdf); - assert(test_near(n.x, 1.0f, 0.001f) && test_near(n.y, 0.0f, 0.001f) && test_near(n.z, 0.0f, 0.001f)); + assert(test_near(n.x, 1.0f, 0.001f) && test_near(n.y, 0.0f, 0.001f) && + test_near(n.z, 0.0f, 0.001f)); // Plane normal should be n vec3 plane_n(0, 1, 0); auto plane_sdf = [plane_n](vec3 p) { return sdf::sdPlane(p, plane_n, 1.0f); }; n = sdf::calc_normal({0, 0, 0}, plane_sdf); - assert(test_near(n.x, plane_n.x, 0.001f) && test_near(n.y, plane_n.y, 0.001f) && test_near(n.z, plane_n.z, 0.001f)); + assert(test_near(n.x, plane_n.x, 0.001f) && + test_near(n.y, plane_n.y, 0.001f) && + test_near(n.z, plane_n.z, 0.001f)); } void test_bvh() { -- cgit v1.2.3