简体   繁体   中英

Is there any way to draw the Concave Polygon in Box2D and detect the collision with other shapes

I am beginner in Box2D physics engine. As I am having a Image with irregular curves I am trying to develop the polygon. But with the reference of the Raywenderlich demo tutorial using the Vertex Helper I am drawing the Polygon but in many cases it produces the concave polygon and when I am executing my Project it crashes.. So If can get some Help for the usage of the concave polygon it would be great.

Any help or suggestions appreciated. Thanks

@Marine; to use concave polygons you'll need to break it into smaller convex polygons. Just break the concave polygon into different convex polygons at the time of body creation and just create shapes for all those individual convex polygons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM