Assert because two Static Bodies collide

Topics: Developer Forum, User Forum
Aug 31, 2011 at 10:13 AM

I upgraded from Farseer 3.2 to 3.3.1 and right on the start of my game I get the following Assert:

World.cs Line 1099

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

 

I am doing something very simple: I want my object to collide with the Viewport (so they bounce back from the border of my window).
To achieve this I just crate 4 rectangles on the position of the border and the objects bounced of just fine.
Its hard to post some code because the Farseer Code is deeper in my engine.
But basicly I just create create these 4 rectangles with BodyFactory.CreateRectangle and setting the BodyType to Static.
Also the rectangles are right next to each other (0 pixle in between) but they dont overlap.

Strange thing is: if i set a breakpoint early somewhere in my project (like in a constructor) they Assert doesnt occour oO

How can i make these Viewport Borders without getting this assert?

Regards

 

Jun 19, 2014 at 10:50 AM
Hi,

I have the same problem. I am using Farseer 3.3.1 as well and I have two objects (bodies), One is the floor which is static and the other is a table which is dynamic.
I tried setting the table body to static and the Farseer breaks here as well,
                        BodyType typeA = bA.BodyType;
                        BodyType typeB = bB.BodyType;
                        Debug.Assert(typeA == BodyType.Dynamic || typeB == BodyType.Dynamic);
in the World.cs file.

Has this issue of converting from Dynamic to Static and reverse solved in Farseer 3.5 or is there a work around. I tried removing contacts etc, but that got the code messy.

Thanks
Jul 9, 2014 at 9:57 AM
Hi.....

No reply for so long on this issue......???............ Can I then safely assume that you cannot change a body from static to dynamic and vice-versa once instantiated into the world?

Thanks
Jul 9, 2014 at 10:03 AM
Sorry I'm not using farseer anymore. My post was from 2011.