Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

b2shape Ellipse?

I'm trying to create a elliptical object in box2D (Cocos2D). So far I've used b2CircleShape for that but I've realized that it ain't gonna cut it no more, I have to have elliptically shaped body. Is it posible? I've tried with b2PolygonShape but than my edges are linear and I need them to be curved.

Anybody had a same problem? Any suggestions?

like image 213
paxx Avatar asked Jan 26 '26 18:01

paxx


1 Answers

You can try with a polygon shape and create the "ellipse" from segments: the ellipse will be a convex polygon for sure, and you can add a reasonable number of segments. This will be just an approximation, but you can fine tune later the number of segments to give you the best ration between performance and approximation to the original shape.

like image 104
funkaster Avatar answered Jan 29 '26 10:01

funkaster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!