Box penetration problem
Posted: Mon Sep 29, 2008 8:04 am
Hi all,
I'm implementing Bepu Physics into my graphics engine for XNA. I simply create a new space lefting all settings to default. Next, i create a simple scene with a static cube for the ground, and 3 dynamic boxes falling down. Here it's the code:
When i draw the box with the result matrix, i see the 3 boxes falling down but there are many penetration each other. I try adding more boxes to the silmulation and some sphere, and the result is there are some boxes/spheres penatrating and other works fine. In add, there is much instability because the box/sphere that are penetrating each other, also with the ground box, continues bouncing, moving and rotating a little bit because they are in an instable position.
Could you help me?
Thanks in advance!
Fax3D
I'm implementing Bepu Physics into my graphics engine for XNA. I simply create a new space lefting all settings to default. Next, i create a simple scene with a static cube for the ground, and 3 dynamic boxes falling down. Here it's the code:
Code: Select all
Space m_Space;
Entity m_staticBox;
Entity m_dynBox1;
Entity m_dynBox2;
Entity m_dynBox3;
void Initialize()
{
m_Space = new Space();
m_staticBox = new Box(new Vector3(0, 0, 0), 400f, 1f, 400f);
m_dynBox1 = new Box(new Vector3(0, 100, 0), 50f, 50f, 50f, 10f);
m_dynBox2 = new Box(new Vector3(0, 200, 0), 50f, 50f, 50f, 10f));
m_dynBox3 = new Box(new Vector3(0, 300, 0), 50f, 50f, 50f, 10f));
m_Space.add(m_staticBox);
m_Space.add(m_dynBox1);
m_Space.add(m_dynBox2);
m_Space.add(m_dynBox3);
}
void Update(GameTime p_GameTime)
{
space.update(GameTime);
Matrix _matrixStaticBox = m_staticBox.orientationMatrix * Matrix.CreateTranslation(m_staticBox.centerOfMass);
Matrix _matrixDynBox1 = m_dynBox1.orientationMatrix * Matrix.CreateTranslation(m_dynBox1.centerOfMass);
Matrix _matrixDynBox2 = m_dynBox2.orientationMatrix * Matrix.CreateTranslation(m_dynBox2.centerOfMass);
Matrix _matrixDynBox3 = m_dynBox3.orientationMatrix * Matrix.CreateTranslation(m_dynBox3.centerOfMass);
}
Could you help me?
Thanks in advance!
Fax3D