Box2D_v2.2.1
When i use b2Draw to see my physic world. The last point of b2ChainShape is not draw.
In b2World::DrawShape,
It is bug or feature???
Solution, just add DrawCicle after for to draw last point.
When i use b2Draw to see my physic world. The last point of b2ChainShape is not draw.
In b2World::DrawShape,
Code:
case b2Shape::e_chain:
{
b2ChainShape* chain = (b2ChainShape*)fixture->GetShape();
int32 count = chain->m_count;
const b2Vec2* vertices = chain->m_vertices;
b2Vec2 v1 = b2Mul(xf, vertices[0]);
for (int32 i = 1; i < count; ++i)
{
b2Vec2 v2 = b2Mul(xf, vertices[i]);
m_debugDraw->DrawSegment(v1, v2, color);
m_debugDraw->DrawCircle(v1, 0.05f, color); //Only first point each segment is draw
v1 = v2;
}
}
break;
{
b2ChainShape* chain = (b2ChainShape*)fixture->GetShape();
int32 count = chain->m_count;
const b2Vec2* vertices = chain->m_vertices;
b2Vec2 v1 = b2Mul(xf, vertices[0]);
for (int32 i = 1; i < count; ++i)
{
b2Vec2 v2 = b2Mul(xf, vertices[i]);
m_debugDraw->DrawSegment(v1, v2, color);
m_debugDraw->DrawCircle(v1, 0.05f, color); //Only first point each segment is draw
v1 = v2;
}
}
break;
It is bug or feature???
Solution, just add DrawCicle after for to draw last point.