Box2d texture?

Am I mistaken or there isn t yet a way to directly apply textures to box2d objects ?
tx
Simone

more findings: GetPolygons actually can give the proper center index, but I am still missing the way to get the texture rotation.
All I can see now is some rather difficult (for me) math calculation with vertices and center to get the rotation angle… isn t there a node to save my day?
cheers

So rotation can be retrieved from the GetBodyDetails node and with a getSlice node (bin=-1) I can get the proper rotation for each box. The problem now comes back when I add another element, in this case a EdgeChain, how can I fix the proper indexing of rotation slices? …
tx

Box2dTEST.v4p (60.9 kB)

Hello,

all box2d types (bodies/shapes) supports getslice (Node),

so small modules to do filtering comes in handy.

Using custom pin makes it also easy to retrieve what you want.

You can then use this small modules to filter by custom.

If you have any other question let me know.

vux

GetBodyByCustom (Box2d).v4p (7.3 kB)

heh
always wondered what the custom pin was about …
yep I have another little mysterious issue: when the body IDs count gets to 105 the indexes of the bodies get messed around…
Any idea? I can post some screenshot maybe, but it should happen if you trigger more than 105 bodies with the previous patch.
thanks

Hello,

output bodies order is from newest created to oldest.

Not sure about this 105 bodies, never experienced that,
a screenshot (or better, small patch example) would definitely be handy.

Thanks

and my box2d at beta23 still not work((((((

hi
the patch attached will reproduce the issue. Create more than 100 bodies and you ll see.

Hello,

your getslice on the rotate has a bin size of -1, it should be 1.

Otherwise at 100 bodies you create 10000 quads.

Thanks

Hi Vux thanks for the support, I have another little doubt.
The GetbodyByCustom had the same effect on my patch as a freshly baked butter croissant on my morning coffee and milk… ie: it made the world more clear, my mind less cluttered and gave an overall good kick… still I wonder (see attached patch) why am I not able to trigger each box independently ?
I am beginning to grasp the essential of spreads but still missing some little pieces to get together…

Simone

btw: on Thursday I ll be projecting something for the first time for a friends’ band concert
www.myspace.com/gafmusic

Hi
changing the binsize to 1 instead of -1 doesn t get the proper slice for the rotation. But it solves the textures weirdness problem… of course. mmm

Hello, did you filtered the bodies first?

You can filter bodies using the module and use getbodydetails on the filtered list, then you should get rotation right.

Yep there was an extra and useless getslice since the objetcts where already filtered by the custom pin…