How to create an arc shape?

Official forum for the Chipmunk2D Physics Library.
Post Reply
wenshu
Posts: 1
Joined: Fri Jan 02, 2009 7:02 pm
Contact:

How to create an arc shape?

Post by wenshu »

I want a static arc shape (portion of circle), but I cannot find how to do that in document, any idea?

Thanks
maximile
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK
Contact:

Re: How to create an arc shape?

Post by maximile »

You can't. The best you can do is approximate it with lots of faces on a polygon or line segments.
mobilebros
Posts: 90
Joined: Tue Aug 04, 2009 9:53 am
Contact:

Re: How to create an arc shape?

Post by mobilebros »

Just curious if anyone has any insight on why simulating an arc shape would be hard. It "seems" easy enough: recognize as a circle but with extra checks against angle and distance (I realize this functionality is not in chipmunk... yet); anyone?
zaerl
Posts: 40
Joined: Fri Aug 28, 2009 8:36 am
Contact:

Re: How to create an arc shape?

Post by zaerl »

1) Create a cpCircleShape
2) Create your own collision callback in which you return 1 only when the collision normal is contained in the arc

cpCollFunc contains all the informations you need.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests