Skip to content

Commit

Permalink
CI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto committed Jul 28, 2024
1 parent 24b3ada commit e4544e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions samples/sample_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -66,7 +67,7 @@ class BenchmarkBarrel : public Sample
m_bodies[i] = b2_nullBodyId;
}

m_shapeType = e_caspuleShape;
m_shapeType = e_circleShape;

CreateScene();
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "box2d/math_functions.h"

#include <float.h>
#include <stddef.h>

_Static_assert(b2_maxPolygonVertices > 2, "must be 3 or more");

Expand Down

0 comments on commit e4544e8

Please sign in to comment.