• Runtimes
  • [Corona] Help to position bounding box on a bone

Related Discussions
...

Hi hsanchezp, Badlogic,

Guy, is there any update with this? is there anything on the horizon?
it's very crucial for our game. We are struggling with this for few weeks.

Thank you,

We've summarized all findings in the issue [corona] Provide physics integration example · #892

The gist of it is that Corona's physics API will center all shapes you add (!) which makes it almost impossible to compensate for. And even if you compensate for it, you then run into the problem of having to update the shapes every frame, which also means destroying and recreating them. I'm afraid we haven't found a solution for this yet.

12 dias depois

Badlogic, I have added a post on the corona sdk forums regarding this constrain in the physics API. lets see what comes back.

Awesome, thanks!

No probs. Heres Brent Sorrentino's (corona staff) reply badlogic. What are your thoughts?

Does Spine actually "redraw" every single physical outline to match the visual appearance as the model animates, and do so every frame? For instance, if an "arm" stretches, is the physical bounaries of that arm supposed to warp/stretch along with the visual representation coming from Spine? From a Box2D standpoint, which of course Corona uses, I don't see how this is possible without "re-creating the shape" every frame as the Spine runtime author indicates. I've never heard of Box2D being able to dynamically warp and modify shapes on the fly, as it's a physics engine based on rigid bodies... so then, from Spine's standpoint, I'm not sure how the other runtimes which use Box2D handle this (there is a wide list of runtimes they support, and some of those engines have Box2D at the core, just like Corona).

In terms of "centering", it has always been possible to re-orient a polygonal body around a different point, by simply adjusting the vertices. Chain shapes can be done in a similar way, since they accept a series of vertices to draw the shape.

I'm curious to see where we can get with this, as Spine is an amazing tool, and you're not the first person who has faced this issue. Keep me updated please... Brent

Thanks for posting the respone! The Box2D integration would only really work for bounding boxes that do not scale or deform, as Brent outlined in his first paragraph. Re-creating the shapes every frame would not work with Box2D, so that's a hard limitation.

As for the vertices offsetting and chain shapes: I'm aware of these possibilities. But the issue is that it would still require me to update the vertices every frame. I'll jump into that other thread and see if I can get more ideas from Brent!