case b2_chainSegmentShape:
{
b2Segment* segment = &shape->chainSegment.segment;
b2Vec2 p1 = b2TransformPoint( xf, segment->point1 );
b2Vec2 p2 = b2TransformPoint( xf, segment->point2 );
draw->DrawSegmentFcn( p1, p2, color, draw->context );
draw->DrawPointFcn( p2, 4.0f, color, draw->context );
draw->DrawSegmentFcn( p1, b2Lerp( p1, p2, 0.1f ), b2_colorPaleGreen, draw->context );
}
I added drawing of normals in my debug drawing of segments so I can see if the chains for tilemapcolliders were generated correctly so I can collide on the correct side of the chain since these are one sided for collisions. But I saw 2 normals being drawn per what I assumed was one segment, so I've been debugging my collider generation code for a whole day only to come to the conclusion that my code was correct all along and that two draw segment calls were made by box2d, I assume the second call is for a direction vector or something? If so it would be nice if this is put behind a setting so that it doesn't get drawn by default and that I can turn it on or off myself.
In wold.c :
I added drawing of normals in my debug drawing of segments so I can see if the chains for tilemapcolliders were generated correctly so I can collide on the correct side of the chain since these are one sided for collisions. But I saw 2 normals being drawn per what I assumed was one segment, so I've been debugging my collider generation code for a whole day only to come to the conclusion that my code was correct all along and that two draw segment calls were made by box2d, I assume the second call is for a direction vector or something? If so it would be nice if this is put behind a setting so that it doesn't get drawn by default and that I can turn it on or off myself.