Box2D Forums

It is currently Fri Oct 31, 2014 12:33 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jun 18, 2010 1:26 am 
Offline

Joined: Fri Jan 15, 2010 6:08 am
Posts: 8
Hi everyone.. I will divide my question into small parts so that is easier to reply :

1) I wanted to ask is there a way to test pixel perfect overlap using BOX2D between 2 images of any shape, offset, origin etc..
HitTest variatons are really slow so i was thinking is there a way to use Box2D only for that ?

2) Since in that case i wouldn't need any actualy pyshics , but bodies should follow the pictures instead, what would the best way to do it ?

3) Since i can access pixels of bitmap data i was thinking to make a body for each pixel that is not transparent and then somehow group them... Is there a way to group them so that they are fixed and grouped together forever.. And did someone made already something like this ? Obviously i could make a algorithm that would make biggest rectangles as possible so not all bodies would be 1x1 size.. Not sure how i would make them same size since Box2D uses meters, i guess simple conversion would do it huh...

4) Ok this question is similar to 3), but much more simple ( and a little different though) . Did someone make a function that transforms picture of any shape ( or at least some ) into Box2D body ?

Thanks in advance


Top
 Profile  
 
PostPosted: Fri Jun 18, 2010 10:28 am 
Offline

Joined: Mon Jan 07, 2008 10:51 am
Posts: 1911
Box2D has no support for arbitrary collision hulls. It is likely that using many shapes to cover the pixels exactly will severely strain the engine, too.

It is recommended you outline the shapes, using automatic or manual techniques. Neither is particularly easy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group