I'm looking for a way to deform the physic shapes.
Say I have a game character standing on a very simple b2body, consisting of one fixture made of edges:
File comment: Digging the ground
Screen Shot 2012-06-12 at 14.21.45.png [ 54.58 KiB | Viewed 654 times ]
The player wants to dig a hole (like in Lemmings, Lode Runner, etc.). I imagined substracting a "dig" round shape from the ground shape:
File comment: Dig shape
Screen Shot 2012-06-12 at 14.21.50.png [ 44.78 KiB | Viewed 654 times ]
The childish formulation of this would be "substract the circle from the rectangle and keep the resulting polygon":
File comment: Resulting polygon
Screen Shot 2012-06-12 at 14.22.02.png [ 18.46 KiB | Viewed 654 times ]
Two questions now...
- Is there anything like this in Box2D?
- (if not) am I making any sense imagining this would be a great solution?
Of course, if you know about a method to accomplish the same result as pictured in my (splendid) drawings... I'll be very glad to hear about it!
edit: I see the following on Wikipedia: http://en.wikipedia.org/wiki/Constructi ... d_geometry
seems what I'm trying to achieve has a name
Actually willing to get the red box minus blue sphere result. In 2D. And in Box2D
Thanks a lot,