MCPcopy Create free account
hub / github.com/axmolengine/axmol / DrawAABB

Method DrawAABB

tests/cpp-tests/Source/Box2DTestBed/test.cpp:493–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493void Test::DrawAABB(b2AABB* aabb, const b2Color& color)
494{
495 b2Vec2 p1 = aabb->lowerBound;
496 b2Vec2 p2 = b2Vec2(aabb->upperBound.x, aabb->lowerBound.y);
497 b2Vec2 p3 = aabb->upperBound;
498 b2Vec2 p4 = b2Vec2(aabb->lowerBound.x, aabb->upperBound.y);
499
500 Vec2 verts[] = {
501 Vec2(p1.x * g_debugDraw.mRatio, p1.y * g_debugDraw.mRatio) + g_debugDraw.debugNodeOffset,
502 Vec2(p2.x * g_debugDraw.mRatio, p2.y * g_debugDraw.mRatio) + g_debugDraw.debugNodeOffset,
503 Vec2(p3.x * g_debugDraw.mRatio, p3.y * g_debugDraw.mRatio) + g_debugDraw.debugNodeOffset,
504 Vec2(p4.x * g_debugDraw.mRatio, p4.y * g_debugDraw.mRatio) + g_debugDraw.debugNodeOffset,
505 };
506 debugDrawNode->drawPolygon(verts, sizeof(verts) / sizeof(verts[0]),
507 Color4F(color.r / 2, color.g / 2, color.b / 2, 0), 0.4f,
508 Color4F(color.r, color.g, color.b, color.a));
509}
510
511void Test::Flush()
512{

Callers

nothing calls this directly

Calls 4

b2Vec2Function · 0.50
Vec2Function · 0.50
Color4FFunction · 0.50
drawPolygonMethod · 0.45

Tested by

no test coverage detected