Level Editor overlapping static bodies assert question

Dec 11, 2011 at 4:57 AM

Hello everyone,

I have been working on a 2D level editor and I have it setup so that I can pickup any object on the screen with the A button and once selected I can toggle it from static to dynamic and back using the right bumper.  I also set it up so I can run or pause the simulation.  For the most part it works really well, but from time to time I get an Assert error related to the following line in the World.cs file:

Debug.Assert(typeA == BodyType.Dynamic || typeB == BodyType.Dynamic);

My level editor is designed so that dynamic objects cannot overlap but static objects can overlap so the user can create more advanced layouts with object layers.  It seems to typically bring this error up when they are overlapping though I haven't pinned it down to this.  If someone can explain what this is checking for maybe it will help me understand what to look for and change in my design.

 

Thanks,

 

Adam Culberson

Dec 12, 2011 at 2:25 AM

So it looks like it comes up when the two objects at TOI are both static.  It doesn't come up every time, but basically after there are more then 5 static objects on screen if two of them are touching it occurs.  I've tried many things tonight to work around it but then end solution was to comment out the debug.assert line.  It doesn't seem to have any negative effects on the simulation so I'm going with it unless someone can give me a better idea.

 

Thanks,

 

Adam

Jan 23, 2012 at 3:18 PM
Edited Jan 23, 2012 at 8:28 PM

EDIT: Never mind, my mistake.