340
340
bool advanceRay = settings->pause == 0 || settings->singleStep;
342
342
Test::Step(settings);
343
m_debugDraw.DrawString(5, m_textLine, "Press 1-6 to drop stuff, m to change the mode");
343
g_debugDraw.DrawString(5, m_textLine, "Press 1-6 to drop stuff, m to change the mode");
344
344
m_textLine += DRAW_STRING_NEW_LINE;
348
m_debugDraw.DrawString(5, m_textLine, "Ray-cast mode: closest - find closest fixture along the ray");
348
g_debugDraw.DrawString(5, m_textLine, "Ray-cast mode: closest - find closest fixture along the ray");
352
m_debugDraw.DrawString(5, m_textLine, "Ray-cast mode: any - check for obstruction");
352
g_debugDraw.DrawString(5, m_textLine, "Ray-cast mode: any - check for obstruction");
356
m_debugDraw.DrawString(5, m_textLine, "Ray-cast mode: multiple - gather multiple fixtures");
356
g_debugDraw.DrawString(5, m_textLine, "Ray-cast mode: multiple - gather multiple fixtures");
372
372
if (callback.m_hit)
374
m_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
375
m_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f));
374
g_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
375
g_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f));
376
376
b2Vec2 head = callback.m_point + 0.5f * callback.m_normal;
377
m_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f));
377
g_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f));
381
m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
381
g_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
384
384
else if (m_mode == e_any)
389
389
if (callback.m_hit)
391
m_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
392
m_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f));
391
g_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
392
g_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f));
393
393
b2Vec2 head = callback.m_point + 0.5f * callback.m_normal;
394
m_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f));
394
g_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f));
398
m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
398
g_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
401
401
else if (m_mode == e_multiple)
403
403
RayCastMultipleCallback callback;
404
404
m_world->RayCast(&callback, point1, point2);
405
m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
405
g_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
407
407
for (int32 i = 0; i < callback.m_count; ++i)
409
409
b2Vec2 p = callback.m_points[i];
410
410
b2Vec2 n = callback.m_normals[i];
411
m_debugDraw.DrawPoint(p, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
412
m_debugDraw.DrawSegment(point1, p, b2Color(0.8f, 0.8f, 0.8f));
411
g_debugDraw.DrawPoint(p, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
412
g_debugDraw.DrawSegment(point1, p, b2Color(0.8f, 0.8f, 0.8f));
413
413
b2Vec2 head = p + 0.5f * n;
414
m_debugDraw.DrawSegment(p, head, b2Color(0.9f, 0.9f, 0.4f));
414
g_debugDraw.DrawSegment(p, head, b2Color(0.9f, 0.9f, 0.4f));
455
455
vs[i] = b2Mul(xf, shape.m_vertices[i]);
458
m_debugDraw.DrawPolygon(vs, 4, color);
459
m_debugDraw.DrawSegment(input.p1, input.p2, color);
458
g_debugDraw.DrawPolygon(vs, 4, color);
459
g_debugDraw.DrawSegment(input.p1, input.p2, color);