first of all great product!
I have nodified the BasicSetupDemo source to have a couple of bars fall down on top of each other. To problem is that the last bars jump up (bounce). Is it possible to suppress this?
I know that there are a lot of settings that I can tweak the physics with ...
in the BasicSetupGame.cs i have nodified this:
LoadContent() methode
Remove:
Code: Select all
space.add(new Box(new Vector3(0, 4, 0), 1, 1, 1, 1));
space.add(new Box(new Vector3(0, 8, 0), 1, 1, 1, 1));
space.add(new Box(new Vector3(0, 12, 0), 1, 1, 1, 1));
Code: Select all
//Create bars
float Height = 5;
bool Switch = true;
int mass = 1;
float Size = 1;
float Space = 0.25f;
float lengte = Size * 3 + Space * 2;
for (int iCounter = 1; iCounter < 5; iCounter++)
{
if (Switch)
{
space.add(new Box(new Vector3(0, Height, 0), 1, 1, lengte, mass));
space.add(new Box(new Vector3(1.25f, Height, 0), 1, 1, lengte, mass));
space.add(new Box(new Vector3(2.5f, Height, 0), 1, 1, lengte, mass));
}
else
{
space.add(new Box(new Vector3(1.25f, Height, 1.25f), lengte, 1, 1, mass));
space.add(new Box(new Vector3(1.25f, Height, 0), lengte, 1, 1, mass));
space.add(new Box(new Vector3(1.25f, Height, -1.25f), lengte, 1, 1, mass));
}
Height += 3f;
Switch = !Switch;
}
I have have added
Code: Select all
box.collisionMargin = 0f
Code: Select all
foreach (Entity e in space.entities)
{
Box box = e as Box;
if (box != null) //This won't create any graphics for an entity that isn't a box since the model being used is a box.
{
box.collisionMargin = 0f;
Matrix scaling = Matrix.CreateScale(box.width, box.height, box.length); //Since the cube model is 1x1x1, it needs to be scaled to match the size of each individual box.
//Add the drawable game component for this entity to the game.
Components.Add(new EntityModel(e, cubeModel, scaling, this));
}
}