Strange collisions of BoxShapes

Hi everybody,

I played around a bit with MultiShapeEntity and built some kind of wall. It's about 4 meters wide and 3 meters high with a mass of about 900 kg inspired by the TableEntity of SimulationTutorial2. Additionally I put a simple box in my simulation environment with 0.4x0.2x0.2 meters in dimension and a mass of 1 kg, it looks like this:

http://www.lespocky.de/kram/wall_before.jpg


Now I configured the camera to have a solid body about the simulation menu and moved it against the wall causing the wall to fall. The wall fallsthrough the box and after that the box lies on the wall, looking like that:


http://www.lespocky.de/kram/wall_after.jpg


Now that's not physic as I remember. What's going wrong here?

btw: this web forum editor is crazy. It costed me almost a half hour to write a good looking post and I still didn't get pictures included. The HtmlView tab bugs me, 'cause HTML I type seems to be ignored.

[1222 byte] By [AlexanderDahl] at [2008-1-8]
# 1
Does everything look aligned correctly when you view the simulation from physics view? Do the two entities collide at all?

Stanlo at 2007-10-2 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 2

The combined physics view shows the edges of the boxes at the right position. This is as assumed. I used simple BoxShapes without additional mesh for cute graphics. The two entities collide. Before the wall is falling, the simple box lies on the ground. The wall falls, the box "jumps" and then lies on the fallen wall and not on the ground anymore so some kind of collision takes place. See:

http://www.lespocky.de/kram/wall_after_with_physics.jpg

If I change the mass of the simple box from 1 kg to 1000 kg, the wall does not fall "through" the box anymore but lies above:

http://www.lespocky.de/kram/wall_above_box.jpg

AlexanderDahl at 2007-10-2 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 3
What is the mass of the wall?
Stanlo at 2007-10-2 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 4
<P>mass of the wall was about 900 kg. <IMG src="http://forums.microsoft.com/MSDN/WebResource.axd?d=NySzF1eivP_rMoc50GQJzcvS4MHMOEKwYrCIgDtzuzlw7GsNki3H_INlfYaLgkxFmac-VIm2t3F15sLUhe5iKuA0JNA_VrWx4LNOoZPN6Cc1&amp;t=633142628060000000"></P>
<P>&nbsp;</P>
<P align=left>I have another strange thing. I improved the wall and set a door in (without joints, it's very hard to understand joints from the tutorial <IMG src="http://forums.microsoft.com/MSDN/WebResource.axd?d=NySzF1eivP_rMoc50GQJzcvS4MHMOEKwYrCIgDtzuzlw7GsNki3H_INlfYaLgkxFSSG0MZbJ1z6uFFjZvu3APg2&amp;t=633142628060000000">). The wall is one MultiShapeEntity and the door is another, both containing just simple BoxShapes:</P>
<P align=left>&nbsp;</P><FONT size=1>
<P align=left></FONT><FONT color=#0000ff size=1>
<DIV class=codeseg>
<DIV class=codecontent>
<DIV class=codesniptitle><SPAN style="WIDTH: 100%">Code Snippet</SPAN></DIV>
<P align=left><FONT color=#0000ff size=1>public</FONT><FONT size=1> DoorEntity(</FONT><FONT color=#008080 size=1>Vector3</FONT><FONT size=1> position, </FONT><FONT color=#0000ff size=1>float</FONT><FONT size=1> doorWidth, </FONT><FONT color=#0000ff size=1>float</FONT><FONT size=1> doorHeight, </FONT><FONT color=#0000ff size=1>float</FONT><FONT size=1> doorThickness)</P>
<P align=left>{</P>
<P align=left>m_doorWidth = doorWidth;</P>
<P align=left>m_doorHeight = doorHeight;</P>
<P align=left>m_doorThickness = doorThickness;</P>
<P align=left></FONT><FONT color=#008000 size=1>// Setze Position des ganzen MultiShapeEntity auf die übergebene Position</P></FONT><FONT size=1>
<P align=left>State.Pose.Position = position;</P>
<P align=left></FONT><FONT color=#008000 size=1>// Shape für das Türblatt</P></FONT><FONT size=1>
<P align=left>m_doorLeaf = </FONT><FONT color=#0000ff size=1>new</FONT><FONT size=1> </FONT><FONT color=#008080 size=1>BoxShape</FONT><FONT size=1>(</P>
<P align=left></FONT><FONT color=#0000ff size=1>new</FONT><FONT size=1> </FONT><FONT color=#008080 size=1>BoxShapeProperties</FONT><FONT size=1>(</P>
<P align=left>0.0f, </FONT><FONT color=#008000 size=1>// Masse 0, wird nachher über Dichte gesetzt</P></FONT><FONT size=1>
<P align=left></FONT><FONT color=#0000ff size=1>new</FONT><FONT size=1> </FONT><FONT color=#008080 size=1>Pose</FONT><FONT size=1>(</FONT><FONT color=#0000ff size=1>new</FONT><FONT size=1> </FONT><FONT color=#008080 size=1>Vector3</FONT><FONT size=1>(0, 0, 0)), </FONT><FONT color=#008000 size=1>// relativ zum Ursprung des MultiShapeEntity</P></FONT><FONT size=1>
<P align=left></FONT><FONT color=#0000ff size=1>new</FONT><FONT size=1> </FONT><FONT color=#008080 size=1>Vector3</FONT><FONT size=1>(m_doorWidth, m_doorHeight, m_doorThickness)</P>
<P align=left>)</P>
<P align=left>);</P>
<P align=left>m_doorLeaf.State.TextureFileName = </FONT><FONT color=#800000 size=1>"Wood_cherry.jpg"</FONT><FONT size=1>;</P>
<P align=left>m_doorLeaf.State.MassDensity.Density = 0.46e3f; </FONT><FONT color=#008000 size=1>// mittlere Dichte für Holz</P></FONT><FONT size=1>
<P align=left></FONT><FONT color=#008000 size=1>// jetzt noch die einzelnen Shapes zu BoxShapes hinzufügen, die </P></FONT><FONT size=1>
<P align=left></FONT><FONT color=#008000 size=1>// ist in MultiShapeEntity public deklariert und muss aus der </P></FONT><FONT size=1>
<P align=left></FONT><FONT color=#008000 size=1>// abgeleiteten Klasse heraus definiert werden</P></FONT><FONT size=1>
<P align=left>BoxShapes = </FONT><FONT color=#0000ff size=1>new</FONT><FONT size=1> </FONT><FONT color=#008080 size=1>List</FONT><FONT size=1>&lt;</FONT><FONT color=#008080 size=1>BoxShape</FONT><FONT size=1>&gt;();</P>
<P align=left>BoxShapes.Add(m_doorLeaf);</P>
<P align=left>}</P></FONT>
<P align=left>&nbsp;</P></DIV></DIV>
<P align=left>&nbsp;</P></FONT>
<P>As you can see I now set density instead of mass and get another strange behaviour: </P>
<P align=left>&nbsp;</P>
<P align=left><IMG src="http://www.lespocky.de/msrs/wall_in_door_far.jpg"></P>
<P align=left>&nbsp;</P>
<P align=left><IMG src="http://www.lespocky.de/msrs/wall_in_door_near.jpg"></P>
<P align=left>&nbsp;</P>
<P align=left>All I did was pushing the door a little into the "door frame" to see it collide with the wall, but it goes into (!) the wall. <IMG src="http://forums.microsoft.com/MSDN/WebResource.axd?d=NySzF1eivP_rMoc50GQJzcvS4MHMOEKwYrCIgDtzuzlw7GsNki3H_INlfYaLgkxFwAr0uh1RPOKhICkOAso47ykZzTt59GYICFvFgYER8fE1&amp;t=633142628060000000"></P>
<P align=left>&nbsp;</P>
<P align=left>&nbsp;</P><FONT size=1>
<P align=left></P></FONT>
AlexanderDahl at 2007-10-2 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 5

*argh* The editor component of this board really sucks.

Again: mass of wall was about 900kg.

I stepped ahead and improved my wall and added a door. Each are MultiShapeEntities containing simple BoxShapes, e.g. the constructor of my door:

Code Snippet

public DoorEntity(Vector3 position, float doorWidth, float doorHeight, float doorThickness)

{

m_doorWidth = doorWidth;

m_doorHeight = doorHeight;

m_doorThickness = doorThickness;

// Setze Position des ganzen MultiShapeEntity auf die übergebene Position

State.Pose.Position = position;

// Shape für das Türblatt

m_doorLeaf = new BoxShape(

new BoxShapeProperties(

0.0f, // Masse 0, wird nachher über Dichte gesetzt

new Pose(new Vector3(0, 0, 0)), // relativ zum Ursprung des MultiShapeEntity

new Vector3(m_doorWidth, m_doorHeight, m_doorThickness)

)

);

m_doorLeaf.State.TextureFileName = "Wood_cherry.jpg";

m_doorLeaf.State.MassDensity.Density = 0.46e3f; // mittlere Dichte für Holz

// jetzt noch die einzelnen Shapes zu BoxShapes hinzufügen, die

// ist in MultiShapeEntity public deklariert und muss aus der

// abgeleiteten Klasse heraus definiert werden

BoxShapes = new List<BoxShape>();

BoxShapes.Add(m_doorLeaf);

}

As you can see I use density instead of mass now. I pushed my wall a little in direction of the door and thought the would collide, but the door just moved right into (!) the wall:

http://www.lespocky.de/msrs/wall_in_door_far.jpg

http://www.lespocky.de/msrs/wall_in_door_near.jpg

Did I miss something on setting up correct physics of my box shapes?

AlexanderDahl at 2007-10-2 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 6

I remember somebody had written about problems with collision detection with high velocities or forces? Could this be the case here? I now have my door connected to the wall with a joint. I can bump it open with a simulated Pioneer 3DX, which is definitly not easy tipping, but work. (I think because of this little robot and this massive door.)

But the door moving alone without being pushed by the camera collides with wall and other entities as it should. Strange.

AlexanderDahl at 2007-10-2 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...

Microsoft Robotics Studio

Site Classified