I created full screen "borders" which contains boxes (boxes should move inside this borderBox). Boxes are dynamic and borderBox is a static body. BorderBox is PolygonShape and boxes are PolygonShape too.

But when I "put" by boxes inside borderBox its automatically move out of the borderBox.

What should I do? Can I use PolygonShape to create such borders or I should just draw lines instead of that?

有帮助吗?

解决方案

b2PolygonShape and b2CircleShape are not hollow. So you can put nothing inside these shapes. What you want to use for screen bounds is b2EdgeShape.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top