box2d 3.0.0
A 2D physics engine for games
 
Loading...
Searching...
No Matches
debug_draw.h
1// SPDX-FileCopyrightText: 2022 Erin Catto
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "types.h"
7
9typedef struct b2DebugDraw
10{
12 void (*DrawPolygon)(const b2Vec2* vertices, int vertexCount, b2Color color, void* context);
13
15 void (*DrawSolidPolygon)(const b2Vec2* vertices, int vertexCount, b2Color color, void* context);
16
18 void (*DrawRoundedPolygon)(const b2Vec2* vertices, int vertexCount, float radius, b2Color lineColor, b2Color fillColor, void* context);
19
21 void (*DrawCircle)(b2Vec2 center, float radius, b2Color color, void* context);
22
24 void (*DrawSolidCircle)(b2Vec2 center, float radius, b2Vec2 axis, b2Color color, void* context);
25
27 void (*DrawCapsule)(b2Vec2 p1, b2Vec2 p2, float radius, b2Color color, void* context);
28
30 void (*DrawSolidCapsule)(b2Vec2 p1, b2Vec2 p2, float radius, b2Color color, void* context);
31
33 void (*DrawSegment)(b2Vec2 p1, b2Vec2 p2, b2Color color, void* context);
34
37 void (*DrawTransform)(b2Transform xf, void* context);
38
40 void (*DrawPoint)(b2Vec2 p, float size, b2Color color, void* context);
41
43 void (*DrawString)(b2Vec2 p, const char* s, void* context);
44
45 bool drawShapes;
46 bool drawJoints;
47 bool drawAABBs;
48 bool drawMass;
49 bool drawContacts;
50 bool drawGraphColors;
51 bool drawContactNormals;
52 bool drawContactImpulses;
53 bool drawFrictionImpulses;
54 void* context;
Color for debug drawing. Each value has the range [0,1].
Definition color.h:8
This struct holds callbacks you can implement to draw a box2d world.
Definition debug_draw.h:10
void(* DrawSolidPolygon)(const b2Vec2 *vertices, int vertexCount, b2Color color, void *context)
Draw a solid closed polygon provided in CCW order.
Definition debug_draw.h:15
void(* DrawCircle)(b2Vec2 center, float radius, b2Color color, void *context)
Draw a circle.
Definition debug_draw.h:21
void(* DrawPoint)(b2Vec2 p, float size, b2Color color, void *context)
Draw a point.
Definition debug_draw.h:40
void(* DrawPolygon)(const b2Vec2 *vertices, int vertexCount, b2Color color, void *context)
Draw a closed polygon provided in CCW order.
Definition debug_draw.h:12
void(* DrawString)(b2Vec2 p, const char *s, void *context)
Draw a string.
Definition debug_draw.h:43
void(* DrawCapsule)(b2Vec2 p1, b2Vec2 p2, float radius, b2Color color, void *context)
Draw a capsule.
Definition debug_draw.h:27
void(* DrawSolidCapsule)(b2Vec2 p1, b2Vec2 p2, float radius, b2Color color, void *context)
Draw a solid capsule.
Definition debug_draw.h:30
void(* DrawSolidCircle)(b2Vec2 center, float radius, b2Vec2 axis, b2Color color, void *context)
Draw a solid circle.
Definition debug_draw.h:24
void(* DrawSegment)(b2Vec2 p1, b2Vec2 p2, b2Color color, void *context)
Draw a line segment.
Definition debug_draw.h:33
void(* DrawTransform)(b2Transform xf, void *context)
Definition debug_draw.h:37
void(* DrawRoundedPolygon)(const b2Vec2 *vertices, int vertexCount, float radius, b2Color lineColor, b2Color fillColor, void *context)
Draw a rounded polygon provided in CCW order.
Definition debug_draw.h:18
types used by the Box2D API
A 2D rigid transform.
Definition types.h:61
Definition types.h:47