4#include <box2d/b2_draw.h>
8 class Box2DDebugger :
public Debugger2D,
public b2Draw
12 ~Box2DDebugger() =
default;
15 void DrawPolygon(
const b2Vec2* vertices, int32 vertexCount,
const b2Color& color)
override;
16 void DrawSolidPolygon(
const b2Vec2* vertices, int32 vertexCount,
const b2Color& color)
override;
17 void DrawCircle(
const b2Vec2& center,
float radius,
const b2Color& color)
override;
18 void DrawSolidCircle(
const b2Vec2& center,
float radius,
const b2Vec2& axis,
const b2Color& color);
19 void DrawSegment(
const b2Vec2& p1,
const b2Vec2& p2,
const b2Color& color)
override;
20 void DrawTransform(
const b2Transform& xf)
override;
21 void DrawPoint(
const b2Vec2& p,
float size,
const b2Color& color)
override;
26 static std::vector<glm::vec2> ConvertB2VecToGlmVec2(
const b2Vec2* vertices, int32 vertexCount)
28 std::vector<glm::vec2> glmVertices;
29 glmVertices.reserve(vertexCount);
30 for (
int i = 0; i < vertexCount; i++)
31 glmVertices.push_back(glm::vec2(vertices[i].x, vertices[i].y));