MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / DrawDebugData

Method DrawDebugData

engine/source/Box2D/Dynamics/b2World.cpp:1135–1237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135void b2World::DrawDebugData()
1136{
1137 if (m_debugDraw == NULL)
1138 {
1139 return;
1140 }
1141
1142 uint32 flags = m_debugDraw->GetFlags();
1143
1144 if (flags & b2Draw::e_shapeBit)
1145 {
1146 for (b2Body* b = m_bodyList; b; b = b->GetNext())
1147 {
1148 const b2Transform& xf = b->GetTransform();
1149 for (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext())
1150 {
1151 if (b->IsActive() == false)
1152 {
1153 DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f));
1154 }
1155 else if (b->GetType() == b2_staticBody)
1156 {
1157 DrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f));
1158 }
1159 else if (b->GetType() == b2_kinematicBody)
1160 {
1161 DrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f));
1162 }
1163 else if (b->IsAwake() == false)
1164 {
1165 DrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f));
1166 }
1167 else
1168 {
1169 DrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f));
1170 }
1171 }
1172 }
1173 }
1174
1175 if (flags & b2Draw::e_jointBit)
1176 {
1177 for (b2Joint* j = m_jointList; j; j = j->GetNext())
1178 {
1179 DrawJoint(j);
1180 }
1181 }
1182
1183 if (flags & b2Draw::e_pairBit)
1184 {
1185 b2Color color(0.3f, 0.9f, 0.9f);
1186 for (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext())
1187 {
1188 //b2Fixture* fixtureA = c->GetFixtureA();
1189 //b2Fixture* fixtureB = c->GetFixtureB();
1190
1191 //b2Vec2 cA = fixtureA->GetAABB().GetCenter();
1192 //b2Vec2 cB = fixtureB->GetAABB().GetCenter();

Callers

nothing calls this directly

Calls 11

GetFlagsMethod · 0.80
GetTransformMethod · 0.80
GetFixtureListMethod · 0.80
IsAwakeMethod · 0.80
DrawPolygonMethod · 0.80
DrawTransformMethod · 0.80
b2ColorClass · 0.70
GetNextMethod · 0.45
IsActiveMethod · 0.45
GetTypeMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected