Existe uma maneira de ver visualmente a fronteira SKPhysicsbody do kit de sprite?
Estou usando bodyWithPolygonFromPath para definir o volume do corpo físico e usado
http://dazchong.com/spritekit/
para obter os caminhos necessários. Mas o caminho não parece correto e desejo ver a fronteira do caminho do corpo físico para ver se a forma está correta.
Existe alguma maneira de ver o esboço do volume do corpo físico?
Eu tentei o código a seguir, mas ele não funciona.
ship = [SKSpriteNode spriteNodeWithImageNamed: @ "Nave espacial"];
CGFloat offsetX = ship.frame.size.width * ship.anchorPoint.x;
CGFloat offsetY = ship.frame.size.height * ship.anchorPoint.y;
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, 50 - offsetX, 110 - offsetY);
CGPathAddLineToPoint(path, NULL, 18 - offsetX, 16 - offsetY);
CGPathAddLineToPoint(path, NULL, 140 - offsetX, 15 - offsetY);
CGPathCloseSubpath(path);
SKShapeNode *yourline = [SKShapeNode node];
yourline.name = @"yourline";
yourline.path = path;
[yourline setStrokeColor:[UIColor redColor]];
[self addChild:yourline];
ship.physicsBody = [SKPhysicsBody bodyWithPolygonFromPath:path];
//[ship setScale:0.5];
ship.zRotation = - M_PI / 2;