I'm rolling a ball around on EdgeShapes, could use triangles as well if that would help. The ball can be rolling on any surface, even upside down and on sides etc. Let's say I want a flag or something sticking straight up from the ball, out from the "ground", that is to say, take the normal of the collision (or average of collisions when several side-by-side, as in corners) and rotate a sprite attached to the ball (if that's the best way to do it).
In regular box2d there seems to be a way to get it, think it was called localNormal or something similar, also possible to get touch points etc. I can't find it here.
Also, calculating this proved to be a bit more difficult than I thought and my trigonometry is kind of rusty. Doing it manually involves having the angle of the EdgeShape and knowing which side of the line the ball is, as well as knowing the "direction" of the line. All of which should be knowable, and I can probably brute force it
but I would really like to hear if this is an already solved problem that someone could share? Thanks!
Especially solutions that does it completely different extra welcome, because usually we have a tendency to not see the forest for the trees, and there is probably something easy and elegant I'm missing here.
(Also, hope you get the chain shapes in the next version, seems like a much better way to do it for a project like mine!)