Reputation: 16588
How can I create a concave SKPhysicsBody?
My guess is to create a composite node that consists of multiple convex bodies. Can I "stick" them any other way that create an SKPhysicsJointFixed between each?
Upvotes: 0
Views: 326
Reputation: 2995
Create two or more SKPhysicsBody variables using convex paths, then create a union of these paths using the initializer SKPhysicsBody.bodyWithBodies. This union can be concave.
Upvotes: 0
Reputation: 2425
You may want to wait a short while - I can't say it explicitly, but there's an intriguing new SKPhysicsBody
method if you look at pre-release docs at developer.apple.com and search for "iOS 7.1 API Diffs".
There is another way - you can simply create new SKNodes
, add your new nodes as the children of your target composite node, and attach convex SKPhysicsBodies
to these child nodes.
EDIT: this will only work for non-dynamic constituent bodies, if you just want to detect contact/collision on a concave composite one that's static.
Upvotes: 1