Merge pull request #12501 from namezero111111/patch-6

Circle shape debug draw bug
This commit is contained in:
子龙山人 2015-07-17 22:53:53 +08:00
commit 45cd7cf681
1 changed files with 5 additions and 2 deletions

View File

@ -936,9 +936,12 @@ void PhysicsDebugDraw::drawShape(PhysicsShape& shape)
{
case CP_CIRCLE_SHAPE:
{
float radius = PhysicsHelper::cpfloat2float(cpCircleShapeGetRadius(subShape));
Vec2 centre = PhysicsHelper::cpv2point(cpBodyGetPos(cpShapeGetBody(subShape)))
+ PhysicsHelper::cpv2point(cpCircleShapeGetOffset(subShape));
Vec2 centre = PhysicsHelper::cpv2point(cpBodyGetPos(cpShapeGetBody(subShape)));
Vec2 offset = PhysicsHelper::cpv2point(cpCircleShapeGetOffset(subShape));
Vec2 rotation(PhysicsHelper::cpv2point(cpBodyGetRot(cpShapeGetBody(subShape))));
centre += offset.rotate(rotation);
static const int CIRCLE_SEG_NUM = 12;
Vec2 seg[CIRCLE_SEG_NUM] = {};