pleerock
pleerock

Reputation: 18846

box2d PolygonShape inside PolygonShape

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?

Upvotes: 1

Views: 439

Answers (1)

Andrew
Andrew

Reputation: 24846

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

Upvotes: 2

Related Questions