I`ve been fighting with it since like eight hours, and I`m fed up. I have basically no idea what may be going wrong.
First and most annoying problem:
I`ve got two tanks in my test app. They both are created like this:
Code: Select all
List<Entity> spheres = new List<Entity>();
for (int i = 0; i < czolg.mdl.Meshes.Count ; i++)
{
ModelMesh mesh = czolg.mdl.Meshes[i];
float rad = mesh.BoundingSphere.Radius * 0.9f;
Box box = new Box(mesh.BoundingSphere.Center, rad, rad, rad, 1000);
spheres.Add(box);
}
tankS = new WrappedBody(playerCar.Position, spheres, 10000);
Second problem:
Gravity doesn`t work. I`m setting it as in an example (scene.Settings.gravity, blabla). Yet it is only visible, when I set it to some ridiculous value (like 0, -90000, 0). And then, objects start to shake.
Third problem:
Rotation. I've been trying to integrate BEPU into existing game core, so I`ve got all classes, input management and so on ready. I figured out something to do translation, and I do it this way:
Code: Select all
tankS.linearVelocity = playerCar.Velocity;
Code: Select all
Matrix World = tankS.worldTransform;
World.Right = playerCar.Right;
World.Forward = playerCar.Direction;
Fourth problem:
Collision Detection sometimes doesn`t work. Especially with StaticTriangleGroup (loaded and created as in example). See a screenshot: http://screenup.pl/?l=9AAUKIP . I`ve managed to "push" one tank beneath the surface with another pretty easily. Surface is StaticTriangleGroup of course.
Fifth problem:
Simulation freezes quite often. I mean - totally. When I do a Break in Visual Studio during that freeze, it shows in call stack, that program frozen during space.update(..) method. It never ends, like infinite loop or sth.
Regards!
Maurycy Chomicz