Интересно, есть ли инструмент, который можно было бы использовать для простого создания сложных физических тел в SpriteKit. Я хотел бы иметь физические тела с многоугольными формами. SpriteKit позволяет создавать такие тела с помощью этого метода:
+ (SKPhysicsBody *)bodyWithPolygonFromPath:(CGPathRef)path
К сожалению, это требует много времени для создания таких путей вручную, и это может быть проблематично при тестировании. Существует приложение SpriteHelper, которое позволяет вам определять форму тела в удобном визуальном редакторе, но это приложение не может экспортировать пути, которые можно использовать здесь. Он был сделан для cocos2d, и он делает много вещей, таких как упаковка текстур и т.д., Которые мне не нужны, и я не могу использовать с SpriteKit. Кто-нибудь знает решение, которое позволит легко определить CGPath или, возможно, автоматически сгенерировать их из png-изображений с альфа-каналом? Хотя функция автогенерации по моему опыту нуждается в оптимизации, потому что формы тела должны быть максимально простыми, если текстуры могут иметь более сложные формы.