Edge Shapes for C++ (Merged!)

shaktool wrote:
I'm sorry, I don't seem to be able to reproduce the bug on my machine. I think Macs will initialize everything to zero anyway. :/ On the plus side, this probably confirms that the bug is a bad variable initialization.

If I can get the testbed to compile on my old windows computer (it doesn't have visual studio...) I'll check it out there.
If you compile it under linux and run it with http://valgrind.org/ you should pick up the uninitialized bugs out very fast.
Windows does not initialize everything to 0, but there is a big chance that an uninitialized value is 0, so then you could still be hunting for a while.
What happened to debug builds initializing to specific values, and release values not initializing at all? I can't find anything on the intarwebs suggesting Macs initialize everything.
*shrug* As I said earlier, I have less experience with C++, but next time I'll look into some sort of debug option. In any case, kne solved the problem, so it's all good.
This is awesome!

I would like "Erin Catto" to make "Thin Line Segment Shapes" part of Box2D core.

Pretty please.
Yes, this will be integrated into the main SVN branch soon.
shaktool wrote:
Yes, this will be integrated into the main SVN branch soon.
Great news 🙂
Edge Shapes are now merged into the main C++ Box2D branch. 🙂 Grab it from SVN.

Thanks again to kne for the help.
BorisTheBrave wrote:
What happened to debug builds initializing to specific values, and release values not initializing at all? I can't find anything on the intarwebs suggesting Macs initialize everything.

You might be right about this - I don't know how the idea came up in this context, but I suggested on another thread a while back that perhaps OS X vs. Windows was causing problems for this reason (not from any real knowledge, but because I saw an OS dependent behavior difference and the bug turned out to be an uninitialized variable), but in retrospect it's very possible that I was running in debug mode in XCode and release in Visual Studio, since IIRC at one point I was having some problems running Visual Studio in debug mode at all.

It's odd, though, I don't see any options in XCode for initializing everything...if it's there, I'd love to turn it off, because it's a terrible idea to only have the training wheels on in debug mode!

It's also quite possible that memory allocation in OS X just happens to be more likely to present you with a fresh block of zeroes than you would normally get in Windows...

shaktool wrote:
Shapes are now merged into the main C++ Box2D branch. 🙂 Grab it from SVN.

Excellent, I'll get to porting this to Java as well fairly soon.
I don't know if these edges are the problem. But does anybody have sleeping problems with objects resting on the edges?
Ok 🙂
Now that Edge Shapes are merged into the main Box2D branch I'm wondering if it's a good idea to rethink my level editor/loader.

Initially for my platform game I was using small contiguous rectangle polygons.
So a minimum of 4 shapes, sometimes far more.

Now with static Edge Shapes this would be easier but how about the calculation speed differences ❓
Is this quicker, same or slower ❓

I would really enjoy the benefit from unregular level design but I wouldn't have to slowdown my current simulation speed ...

In any ways thanks for this new improvement.

Original thread: https://box2d.org/forum/viewtopic.php?t=1577