From e4544e81780b1ae05a1a04a65fff00d522a492a0 Mon Sep 17 00:00:00 2001 From: Erin Catto Date: Sat, 27 Jul 2024 22:17:50 -0700 Subject: [PATCH] CI fix --- samples/sample_benchmark.cpp | 15 +++++++++++---- src/geometry.c | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/samples/sample_benchmark.cpp b/samples/sample_benchmark.cpp index 5b1252b3..8632d8b7 100644 --- a/samples/sample_benchmark.cpp +++ b/samples/sample_benchmark.cpp @@ -18,7 +18,8 @@ class BenchmarkBarrel : public Sample public: enum ShapeType { - e_caspuleShape = 0, + e_circleShape = 0, + e_caspuleShape, e_mixShape, e_compoundShape, e_humanShape, @@ -66,7 +67,7 @@ class BenchmarkBarrel : public Sample m_bodies[i] = b2_nullBodyId; } - m_shapeType = e_caspuleShape; + m_shapeType = e_circleShape; CreateScene(); } @@ -181,7 +182,13 @@ class BenchmarkBarrel : public Sample bodyDef.position = {x + side, y}; side = -side; - if (m_shapeType == e_caspuleShape) + if (m_shapeType == e_circleShape) + { + m_bodies[index] = b2CreateBody(m_worldId, &bodyDef); + circle.radius = RandomFloat(0.25f, 0.75f); + b2CreateCircleShape(m_bodies[index], &shapeDef, &circle); + } + else if (m_shapeType == e_caspuleShape) { m_bodies[index] = b2CreateBody(m_worldId, &bodyDef); capsule.radius = RandomFloat(0.25f, 0.5f); @@ -253,7 +260,7 @@ class BenchmarkBarrel : public Sample ImGui::Begin("Stacks", nullptr, ImGuiWindowFlags_NoResize); bool changed = false; - const char* shapeTypes[] = {"Capsule", "Mix", "Compound", "Human"}; + const char* shapeTypes[] = {"Circle", "Capsule", "Mix", "Compound", "Human"}; int shapeType = int(m_shapeType); changed = changed || ImGui::Combo("Shape", &shapeType, shapeTypes, IM_ARRAYSIZE(shapeTypes)); diff --git a/src/geometry.c b/src/geometry.c index 43edeff7..8d52b35d 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -9,6 +9,7 @@ #include "box2d/math_functions.h" #include +#include _Static_assert(b2_maxPolygonVertices > 2, "must be 3 or more");