Hello everyone,
I'm new to all of this, so bare with me if I'm asking something truly idiotic here.
I'm working on an iphone game with box2d and basically updating the contacts on my hero entity periodically (on each frame, basically). I created the world by parsing a svg file which I constructed a couple of times trying out different things (edges vs. rects vs. polys). In addition, I'm using the contact manifold and it's normal vector to determine what my hero _can_ or _can't_ do (ie. jumping, slide on walls, etc).
This has been pretty reliable, except for the following edge-case, which I can't seem to find a good solution for:

When the body stands directly on top of a poly _corner_ then the normal points directly down... which makes no sense. I'm not sure why that is exactly, maybe it's a limitation of the simulation, not sure. Do you guys have any ideas on how to work around that?
I tried the following to no avail:
- Tried using concave polygons all over the map instead of edge bodies.
- Tried to see if more than one contact was generated (a "good" one besides the "bad" one) No go.
- Tried flattening the edge so it wouldn't be so sharp. Seems to work so long as I keep it above 90 degs (as opposed to a sharp angle like the one in the picture above), but this makes map-making a tad more difficult. I could live with it, but just wondering if there's a better solution.
Any ideas?
Thanks so much, in advance!
I'm new to all of this, so bare with me if I'm asking something truly idiotic here.
I'm working on an iphone game with box2d and basically updating the contacts on my hero entity periodically (on each frame, basically). I created the world by parsing a svg file which I constructed a couple of times trying out different things (edges vs. rects vs. polys). In addition, I'm using the contact manifold and it's normal vector to determine what my hero _can_ or _can't_ do (ie. jumping, slide on walls, etc).
This has been pretty reliable, except for the following edge-case, which I can't seem to find a good solution for:

When the body stands directly on top of a poly _corner_ then the normal points directly down... which makes no sense. I'm not sure why that is exactly, maybe it's a limitation of the simulation, not sure. Do you guys have any ideas on how to work around that?
I tried the following to no avail:
- Tried using concave polygons all over the map instead of edge bodies.
- Tried to see if more than one contact was generated (a "good" one besides the "bad" one) No go.
- Tried flattening the edge so it wouldn't be so sharp. Seems to work so long as I keep it above 90 degs (as opposed to a sharp angle like the one in the picture above), but this makes map-making a tad more difficult. I could live with it, but just wondering if there's a better solution.
Any ideas?
Thanks so much, in advance!