This is the code I used (note that wall is a List of RigidBody and the fourth element of wall is the floor of the box):

Code: Select all

```
for (int i = 0; i<4;i++)
{
var constraint = new Generic6DofSpringConstraint(wall[i], wall[i], Matrix.Identity, Matrix.Identity, true)
{
LinearLowerLimit = new Vector3(1,1,1),
LinearUpperLimit = new Vector3(-1,-1,-1),
AngularLowerLimit = new Vector3(1,1,1),
AngularUpperLimit = new Vector3(-1,-1,-1)
};
//var constraint = new FixedConstraint(wall[4], wall[i], Matrix.Identity, Matrix.Identity)
//{
// LinearLowerLimit = new Vector3(1, 1, 1),
// LinearUpperLimit = new Vector3(-1, -1, -1),
// AngularLowerLimit = new Vector3(1, 1, 1),
// AngularUpperLimit = new Vector3(-1, -1, -1)
//};
colWorld.AddConstraint(constraint);
}
```