Forum

Box2d dynamic line

i’m messing with box2d for quite a while and wonder how to create a dynamic shape…

pretty much like this contour

i checked the source code and tried to create/destroy/create… and edge chain to achieve this kind of dynamic outline. it just seems to slow in vvvv, not nearly as fast as seen in the video.

am i doing something wrong ? any idea how the workflow should look like ?

u7 i think it’s the only way to go
edgechain destroy/create sequence

Maybe you should try to use as minimun point as possible for contour , resampling to a lower spreadcount might increase speed , i did work on one patch like that , but i never achieve a perfect result , since the shape is create and destroy each frame , result is some weird behaviours of colliding object , sometimes they go trough the shape sometime jump like crazy…
I tried many way , also replacing line with quad , but also with no sucess.
Box2d is not really done for this kind of things if you want a perfect result.

cheers bois,

just tried to reduce the update cycle to every second frame and it looks alright with 200 points. i probably dont need that much…

oh oh ! anyone has a simple sample patch showing this destroy/recreate continouslity thing ?

not simple here…
but the technique is simple, just bang create and destroy every frame or every second frame at the same time. there is no hidden secret.
check the edgechain helppatch and just add destroyBody to it. framecounter will help you with the bang.